psql vs. gcc - Mailing list pgsql-hackers

From Karel Zak - Zakkr
Subject psql vs. gcc
Date
Msg-id Pine.LNX.3.96.991217144118.20881B-100000@ara.zf.jcu.cz
Whole thread Raw
Responses Re: [HACKERS] psql vs. gcc
Re: [HACKERS] psql vs. gcc
List pgsql-hackers
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.usenameas \"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
-odescribe.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@zf.jcu.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)
-----------------------------------------------------------------------



pgsql-hackers by date:

Previous
From: wieck@debis.com (Jan Wieck)
Date:
Subject: LONG varsize - how to go on
Next
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] psql vs. gcc