Re: [HACKERS] psql vs. gcc

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Karel Zak - Zakkr <zakkr(at)zf(dot)jcu(dot)cz>
Cc: pgsql-hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] psql vs. gcc
Date: 1999-12-17 17:59:14
Message-ID: 199912171759.MAA19524@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

OK, I have applied a patch to use strcat in the case of MULTIBYTE to add
the needed extra line.

>
> Hi,
>
> If I compile current source, gcc (2.95.2) return interesting error for
> pgsql/describe.c.
>
> gcc command line:
>
> make[1]: Leaving directory /home/PG_DEVEL/pgsql.change/src/interfaces/libpq'
> gcc -I../../interfaces/libpq -I../../include -I../../backend -O2 -Wall
> -Wmissing-prototypes -DMULTIBYTE=LATIN2 -c -o describe.o describe.c
>
>
> The gcc return error for next lines:
>
> ------
> strcpy(buf,
> "SELECT pg_database.datname as \"Database\",\n"
> " pg_user.usename as \"Owner\""
> #ifdef MULTIBYTE
> ",\n pg_database.encoding as \"Encoding\""
> #endif
> );
> -------
>
> If I instead strcpy() write sprintf(buf, ..) all is right.
>
> What is bad, my gcc or previous source code? (IMHO is Peter's code right and
> gcc is a little mazy).
>
> Full error dump:
>
> make -C ../../interfaces/libpq libpq.a
> make[1]: Entering directory `/home/PG_DEVEL/pgsql.change/src/interfaces/libpq'
> make[1]: `libpq.a' is up to date.
> make[1]: Leaving directory `/home/PG_DEVEL/pgsql.change/src/interfaces/libpq'
> gcc -I../../interfaces/libpq -I../../include -I../../backend -O2 -Wall -Wmissing-prototypes -DMULTIBYTE=LATIN2 -c -o describe.o describe.c
> describe.c:324: warning: preprocessing directive not recognized within macro arg
> describe.c:324: warning: preprocessing directive not recognized within macro arg
> describe.c:324: warning: preprocessing directive not recognized within macro arg
> describe.c:324: warning: preprocessing directive not recognized within macro arg
> describe.c:324: warning: preprocessing directive not recognized within macro arg
> describe.c:324: warning: preprocessing directive not recognized within macro arg
> describe.c:324: warning: preprocessing directive not recognized within macro arg
> describe.c:324: warning: preprocessing directive not recognized within macro arg
> describe.c:324: warning: preprocessing directive not recognized within macro arg
> describe.c:324: warning: preprocessing directive not recognized within macro arg
> describe.c:324: warning: preprocessing directive not recognized within macro arg
> describe.c:324: warning: preprocessing directive not recognized within macro arg
> describe.c:324: warning: preprocessing directive not recognized within macro arg
> describe.c:324: warning: preprocessing directive not recognized within macro arg
> describe.c: In function `listAllDbs':
> describe.c:321: undefined or invalid # directive
> describe.c:323: undefined or invalid # directive
> describe.c:324: parse error before `#'
> describe.c:324: parse error before `#'
> describe.c:324: parse error before `#'
> describe.c:324: parse error before `#'
> describe.c:324: parse error before `#'
> describe.c:324: parse error before `#'
> describe.c:324: parse error before `#'
> describe.c:324: parse error before `#'
> describe.c:324: parse error before `#'
> describe.c:324: parse error before `#'
> describe.c:324: parse error before `#'
> describe.c:324: parse error before `#'
> describe.c:324: parse error before `#'
> describe.c:324: parse error before `#'
> describe.c:324: parse error before `#'
> describe.c:324: parse error before `#'
> describe.c:324: parse error before `:'
> make: *** [describe.o] Error 1
>
>
> ----------------------------------------------------------------------
> Karel Zak <zakkr(at)zf(dot)jcu(dot)cz> http://home.zf.jcu.cz/~zakkr/
>
> Docs: http://docs.linux.cz (big docs archive)
> Kim Project: http://home.zf.jcu.cz/~zakkr/kim/ (process manager)
> FTP: ftp://ftp2.zf.jcu.cz/users/zakkr/ (C/ncurses/PgSQL)
> -----------------------------------------------------------------------
>
>
> ************
>

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

  • psql vs. gcc at 1999-12-17 14:11:22 from Karel Zak - Zakkr

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-12-17 18:10:41 Re: [HACKERS] Re: Notation for nextval() (was Re: Several small patches)
Previous Message Jan Wieck 1999-12-17 17:57:40 Re: [HACKERS] LONG varsize - how to go on