Ravenbrook / Projects / Memory Pool System / Issues


MPS issue job000646

Title:Builds on FreeBSD stopped working
Status:closed
Priority:essential
Assigned user:Nick Barnes
Organization:Ravenbrook
Description:MPS 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/​src/​include/​stdlib.h.diff?r1=1.16&r2=1....> and has been broken in FreeBSD releases since 4.3.
Analysis:Should 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 found:manual_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 in:1.100.1
Test procedure:compilation.
Created by:Nick Barnes
Created on:2002‑12‑30 13:53:28
Last modified by:Nick Barnes
Last modified on:2002‑12‑30 13:54:41
History:2002-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).

Generated at 2013-05-25 10:10:13 by $Id: //info.ravenbrook.com/infosys/cgi/issue.cgi#476 $

Copyright © Ravenbrook Limited. This document is provided "as is", without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this document. You may not duplicate or reproduce this document in any form without the express permission of the copyright holder.

Ravenbrook / Projects / Memory Pool System / Issues