[ntp:hackers] c language stuff

M. Warner Losh imp at bsdimp.com
Fri Oct 2 06:20:03 UTC 2009


In message: <85d954180910012304x7e7cef5cw47c104d5401990b6 at mail.gmail.com>
            Dave Hart <davehart at gmail.com> writes:
: On Fri, Oct 2, 2009 at 5:34 AM, Hal Murray <hmurray at megapathdsl.net> wrote:
: >
: > I tried compiling the latest ntp-dev on an old system that's running gcc 2.96
: >
: > It got several errors of the form...
: >
: > {
: >   x = y;
: >  int foo;
: > ...
: >
: > That's a declaration that isn't at the head of a block.
: [...]
: > Do other c compilers support that?  Do we want to encourage that usage?
: > Discourage it?  ...
: 
: For NTP, the minimum requirement is ANSI C aka C89.  So we want to
: discourage that type of use in our code.  Microsoft C++ 2008 in C mode
: also rejects interspersed declarations.

In that case, may I suggest adding -std=iso9899:1990 to the compile
line to help enforce that rule???

Warner


More information about the hackers mailing list