• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X PCB Editor
  3. sklint question

Stats

  • Replies 2
  • Subscribers 160
  • Views 12937
  • Members are here 0
More Content

sklint question

pcbgeorge
pcbgeorge over 16 years ago

I have just started using sklint to try to find errors or less than efficient code.  I have a couple questions to anyone that knows it's ins and outs:

I keep getting a WARN (VAR16) telling me that the declaration of a variable has been superceeded when the variable was declared as local (using a let or prog).  Does this mean a variable in a "for" block is automatically local to that "for" block?  Or is it just an error in sklint and it should still be declared as local?

As an example, I get the warning "declaration of variable i supercedes previous declaration when I run this snippett through sklint:

(let (i)
  (for i 1 10
    (printf "%s\n" i)
  )
)

To add insult to injury, it only gives me an IQ score of 80, even though I am following programming methods!!! :)

Thanks in Advance :)

  • Sign in to reply
  • Cancel
  • skillUser
    skillUser over 16 years ago

     Hi,

     The "loop" variable in a for loop does not need to be explicitly declared in a let statement since it is implicitly declared as a local variable within the scope of the for command.  The same applies to foreach, setof, forall and exists statements.So in this case, sklint warns that the "i" in the let is not needed (or if it is used elsewhere, it is not the same as the "i" within the scope of the for command). The i in the for loop is distinct from the i of the let statement.

    In your case, you do not need to declare i in the let statement, and this should get you back towards a score of 100.

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • pcbgeorge
    pcbgeorge over 16 years ago
    Thanks, Lawrence :)
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information