From owner-freebsd-hackers Fri Apr 21 20:30:01 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id UAA01277 for hackers-outgoing; Fri, 21 Apr 1995 20:30:01 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id UAA01263 for ; Fri, 21 Apr 1995 20:29:52 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id NAA06522; Sat, 22 Apr 1995 13:27:45 +1000 Date: Sat, 22 Apr 1995 13:27:45 +1000 From: Bruce Evans Message-Id: <199504220327.NAA06522@godzilla.zeta.org.au> To: hackers@FreeBSD.org, rpt@miles.sso.loral.com Subject: Re: _ANSI_SOURCE... who defines this puppy Sender: hackers-owner@FreeBSD.org Precedence: bulk >I am trying to get pthreads to build on 2.0R. I have had a number of >problems, but this last one led me down a rat hole that seems to go >beyond pthreads. In one source file was : > #if !defined(_ANSI_SOURCE) > #define CLK_TCK 100 > #endif /* not ANSI */ This is bogus. CLK_TCK is an (obsolescent) POSIX feature. It has nothing to do with ANSI C, and of course applications and libraries shouldn't declare it directly, because it may be (and is in FreeBSD) different from what the application might expect. >This resulted in redefinition of the value in . >So I started to try to hunt down who defines _ANSI_SOURCE. I found it >referenced numerous times in places in the standard includes. But I >can't find anywhere that it is defined. The best gcc does is: ><~/code>> cc -E -dM -ansi foo.c >#define __STRICT_ANSI__ 1 >... >So is this the programmers responsibility to define? Yes. You normally wouldn't want to define it. In FreeBSD, it is supposed to restrict what the ANSI headers declare to only those things that are specified in the standard. Very few things can be compiled using only features that are specified in the standard! __STRICT_ANSI__ is what gcc declares to indicate that the compiler is enforcing strict ANSI C syntax. It is not related to restricting or extending the declarations in the headers. Bruce