Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple warnings when compiling with new gcc #9

Open
patricklauer opened this issue Nov 14, 2017 · 0 comments
Open

Multiple warnings when compiling with new gcc #9

patricklauer opened this issue Nov 14, 2017 · 0 comments

Comments

@patricklauer
Copy link

With gcc-6.4.0 I'm seeing:

x86_64-pc-linux-gnu-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -pipe -fPIC -fPIC -DSHA_NAME=1 -DSHA_LENGTH=20 -I. -I./ -I/usr/include/postgresql-10/server -I/usr/include/postgresql-10/internal  -D_GNU_SOURCE   -c -o src/sha1.o src/sha1.c
src/crc32.c: In function 'crc32_in':
src/crc32.c:22:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   crc32 *out = palloc(sizeof(crc32));
   ^~~~~
src/crc32.c:27:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   long int pout = strtol(in, &p, 16);
   ^~~~
src/crc32.c:38:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
   out = (uint32_t)pout;
       ^
In file included from src/crc32.c:1:0:
src/crc32.c: In function 'crc32_out':
/usr/include/postgresql-10/server/postgres.h:492:27: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
 #define DatumGetUInt32(X) ((uint32) GET_4_BYTES(X))
                           ^
/usr/include/postgresql-10/server/fmgr.h:235:30: note: in expansion of macro 'DatumGetUInt32'
 #define PG_GETARG_UINT32(n)  DatumGetUInt32(PG_GETARG_DATUM(n))
                              ^~~~~~~~~~~~~~
src/crc32.c:6:31: note: in expansion of macro 'PG_GETARG_UINT32'
 #define PG_GETARG_CRC32(N)    PG_GETARG_UINT32(N)
                               ^~~~~~~~~~~~~~~~
src/crc32.c:47:15: note: in expansion of macro 'PG_GETARG_CRC32'
   crc32 *in = PG_GETARG_CRC32(0);
               ^~~~~~~~~~~~~~~
src/crc32.c:49:25: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'crc32 * {aka unsigned int *}' [-Wformat=]
   snprintf(out, 10, "%08x", in);
                         ^
src/md5.c: In function 'md5_recv':
src/md5.c:78:23: warning: pointer targets in passing argument 2 of 'pq_copymsgbytes' differ in signedness [-Wpointer-sign]
  pq_copymsgbytes(buf, result->bytes, nbytes);
                       ^~~~~~
In file included from src/md5.c:15:0:
/usr/include/postgresql-10/server/libpq/pqformat.h:44:13: note: expected 'char *' but argument is of type 'unsigned char *'
 extern void pq_copymsgbytes(StringInfo msg, char *buf, int datalen);
             ^~~~~~~~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant