|
|
Log in / Subscribe / Register

C90 vs C99

C90 vs C99

Posted Nov 3, 2006 1:24 UTC (Fri) by xoddam (subscriber, #2322)
In reply to: Buried in warnings by nix
Parent article: Buried in warnings

Not so. Declarations with initialisations have always been legal at the
beginning of a block.

C99 also permits declarations to follow statements, like C++.


to post comments

C90 vs C99

Posted Nov 14, 2006 20:52 UTC (Tue) by nix (subscriber, #2304) [Link]

In C90 the initializations must be literals: you can't put an arbitrary
function call in there and expect it to work. (That's a GNU C extension,
copied from C++ and also found in C99: look up `Non-Constant Initializers'
in the manual.)


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds