MPS issue job000646

TitleBuilds on FreeBSD stopped working
Statusclosed
Priorityessential
Assigned userNick Barnes
OrganizationRavenbrook
DescriptionMPS builds on FreeBSD have stopped working because <stdlib.h> now includes prototypes for functions like long long strtoll(const char *, char **, int). This function, and the long long type, are in C99. But gcc -ansi -pedantic is C89. There doesn't seem to be a way to tell gcc to talk C99.
There isn't any preprocessor directive to turn off the relevant parts of stdlib.
Incidentally, this file in FreeBSD -current seems to conditionalize the long long stuff according to whether the compiler speaks C99. But that hasn't made it onto the -stable branch of FreeBSD, which broke this way on 2001-03-02: <http://www.freebsd.org/cgi/cvsweb.cgi/...e/stdlib.h.diff?r1=1.16&r2=1.16.2.1&f=h> and has been broken in FreeBSD releases since 4.3.
AnalysisShould the MPS be compiled with a C89 compiler or a C99 compiler? If the former, what should we do about system header files such as this one, which is C99 only? In the meantime, we can use fri4gc.gmk to turn off the -pedantic compiler option.
How foundmanual_test
Evidence $ gmake -f fri4gc.gmk steptest finaltest
 [...]
 fri4gc: fri4gc/hi/steptest.o
 cc1: warnings being treated as errors
 In file included from steptest.c:19:
 /usr/include/stdlib.h:110: warning: ANSI C does not support `long long'
 /usr/include/stdlib.h:114: warning: ANSI C does not support `long long'
Observed in1.100.1
Test procedurecompilation.
Created byNick Barnes
Created on2002-12-30 13:53:28
Last modified byNick Barnes
Last modified on2002-12-30 13:54:41
History2002-12-30 NB Created.

Fixes

Change Effect Date User Description
37425 closed 2002-12-30 13:54:24 Nick Barnes Turn off pedantic ANSI compilation on FreeBSD, because of broken system header files (from FreeBSD 4.3 to at least 4.7).