[prev in list] [next in list] [prev in thread] [next in thread]
List: pcc-list
Subject: Re: [patch] compile cc/cpp/cpp.c with gcc -std=c99
From: Anders Magnusson <ragge () ludd ! ltu ! se>
Date: 2007-10-27 10:01:03
Message-ID: 47230C5F.5000300 () ludd ! ltu ! se
[Download RAW message or body]
Hi Ted,
I'm feeling reluctant to add defines that should not be needed, unless
there are a really
strong reason to do that.
Also, note that -std=c99 do not turn gcc into c99-mode, it still have
its own way of
handling a number of things (like inline) that are not c99-compliant.
So, never
trust that option :-)
-- Ragge
Ted Bullock wrote:
> Revised patch to allow a build with ISO c99 (gcc -std=c99) and
> _POSIX_C_SOURCE=200112L features enabled
>
>
> To test run ./configure CC="gcc -std=c99" && make
>
>
> ------------------------------------------------------------------------
>
> Index: cc/ccom/Makefile.in
> ===================================================================
> RCS file: /cvsroot/pcc/cc/ccom/Makefile.in,v
> retrieving revision 1.13
> diff -u -3 -r1.13 Makefile.in
> --- cc/ccom/Makefile.in 6 Oct 2007 15:19:22 -0000 1.13
> +++ cc/ccom/Makefile.in 27 Oct 2007 03:29:32 -0000
> @@ -2,7 +2,7 @@
> #
> # Makefile.in for ccom
> #
> -XFL=-DPCC_DEBUG -DGCC_COMPAT \
> +XFL=-D_POSIX_C_SOURCE=200112L -DPCC_DEBUG -DGCC_COMPAT \
> -Wall -Wmissing-prototypes -Wstrict-prototypes -Werror
>
> CC = @CC@
> Index: cc/cpp/Makefile.in
> ===================================================================
> RCS file: /cvsroot/pcc/cc/cpp/Makefile.in,v
> retrieving revision 1.14
> diff -u -3 -r1.14 Makefile.in
> --- cc/cpp/Makefile.in 26 Sep 2007 14:48:51 -0000 1.14
> +++ cc/cpp/Makefile.in 27 Oct 2007 03:29:32 -0000
> @@ -2,7 +2,7 @@
> #
> # Makefile.in for cpp
> #
> -XFL=-DCPP_DEBUG -Wall -Wmissing-prototypes -Wstrict-prototypes -Werror
> +XFL=-D_POSIX_C_SOURCE=200112L -DCPP_DEBUG -Wall -Wmissing-prototypes -Wstrict-prototypes -Werror
>
> prefix = @prefix@
> exec_prefix = @exec_prefix@
> Index: cc/cpp/cpp.c
> ===================================================================
> RCS file: /cvsroot/pcc/cc/cpp/cpp.c,v
> retrieving revision 1.70
> diff -u -3 -r1.70 cpp.c
> --- cc/cpp/cpp.c 25 Oct 2007 17:42:47 -0000 1.70
> +++ cc/cpp/cpp.c 27 Oct 2007 03:29:33 -0000
> @@ -77,7 +77,6 @@
> #include <stdlib.h>
> #include <string.h>
> #include <time.h>
> -#include <unistd.h>
> #include <ctype.h>
>
> #ifdef HAVE_ALLOCA_H
> @@ -769,7 +768,7 @@
> * store a character into the "define" buffer.
> */
> void
> -savch(c)
> +savch(usch c)
> {
> if (stringbuf-sbf < SBSIZE) {
> *stringbuf++ = c;
> @@ -1070,10 +1069,8 @@
> * reads function arguments from yylex()
> * result is written on top of heap
> */
> -void
> -expdef(vp, rp, gotwarn)
> - usch *vp;
> - struct recur *rp;
> +static void
> +expdef(usch *vp, struct recur *rp, int gotwarn)
> {
> usch **args, *sptr, *ap, *bp, *sp;
> int narg, c, i, plev, snuff, instr;
> Index: cc/cpp/cpp.h
> ===================================================================
> RCS file: /cvsroot/pcc/cc/cpp/cpp.h,v
> retrieving revision 1.31
> diff -u -3 -r1.31 cpp.h
> --- cc/cpp/cpp.h 18 Oct 2007 20:41:41 -0000 1.31
> +++ cc/cpp/cpp.h 27 Oct 2007 03:29:33 -0000
> @@ -126,7 +126,7 @@
> void yyerror(char *);
> void unpstr(usch *);
> usch *savstr(usch *str);
> -void savch(int c);
> +void savch(usch c);
> void mainscan(void);
> void putch(int);
> void putstr(usch *s);
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic