URL: <http://savannah.gnu.org/bugs/?37069>
Summary: POSIX specifies CC=c99 Project: make Submitted by: None Submitted on: Fri 10 Aug 2012 10:01:17 AM UTC Severity: 3 - Normal Item Group: Bug Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Component Version: 3.82 Operating System: POSIX-Based Fixed Release: None Triage Status: None _______________________________________________________ Details: The POSIX standard for make includes a number of predefined macros, including CC=c99 where c99 is an ISO C99-compliant compiler. On a typical GNU system, c99 is a script that runs gcc -std=c99 ..., which fits the bill. GNU make uses CC=cc, which on a GNU system will be a link to GCC, which still doesn't use the 1999 standard by default. Even if there is a specific reason for the use of CC=cc instead of CC=c99 (and if so, I'd be interested to hear why), POSIX specifies that by adding a dummy target of .POSIX, make shall conform to the standard, so users that explicitly add that target should see CC=c99. Here is a shell script to create a C99 program and a makefile that requests POSIX standards compliance. When make runs on the last line, you'll get errors about GCC not running in c99 mode. cat > ninetynine.c << "-----" #include <stdio.h> int main(){ for (int i=0; i< 10; i++) printf("Hello.\n"); } ----- cat > makefile << "-----" CFLAGS=-g -Wall #use the default build rule. ninetynine: #This rule requests standards-compliant behavior from make .POSIX: ----- make _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?37069> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make