Not logged in
Log in now
Create an account
Subscribe to LWN
Pencil, Pencil, and Pencil
Dividing the Linux desktop
LWN.net Weekly Edition for June 13, 2013
A report from pgCon 2013
Little things that matter in language design
GCC Explorer - an interactive take on compilation
Posted May 28, 2012 16:51 UTC (Mon) by hummassa (subscriber, #307)
Posted May 28, 2012 21:09 UTC (Mon) by gb (subscriber, #58328)
Compiler do know this perfectly, this static array is entirely inside function scope and it's trivial for compiler to find that static const case is absolutely same to plain const case, and that both are never used outside of scope of this function.
Posted May 29, 2012 18:53 UTC (Tue) by hummassa (subscriber, #307)
Posted May 29, 2012 9:41 UTC (Tue) by dgm (subscriber, #49227)
This is one of those places where C shows it's really a medium-level language, that gives you far more control over such little details than anything else.
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds