From gcrypt-devel at mlists.thewrittenword.com Fri Oct 17 20:27:56 2008 From: gcrypt-devel at mlists.thewrittenword.com (Albert Chin) Date: Fri, 17 Oct 2008 13:27:56 -0500 Subject: CL_AS_NOEXECSTACK assumes grep understands -q Message-ID: <20081017182756.GF2789@honinbu.il.thewrittenword.com> Solaris grep doesn't understand -q, used in CL_AS_NOEXECSTACK by m4/noexecstack.m4 for libgcrypt-1.4.3. Patch attached. -- albert chin (china at thewrittenword.com) -------------- next part -------------- Index: m4/noexecstack.m4 =================================================================== --- m4/noexecstack.m4.orig 2008-10-17 18:26:32.809072183 +0000 +++ m4/noexecstack.m4 2008-10-17 18:26:35.014143443 +0000 @@ -37,7 +37,7 @@ EOF if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -S -o conftest.s conftest.c >/dev/null]) \ - && grep -q .note.GNU-stack conftest.s \ + && grep .note.GNU-stack conftest.s >/dev/null \ && AC_TRY_COMMAND([${CCAS} $CCASFLAGS $CPPFLAGS -Wa,--noexecstack -c -o conftest.o conftest.s >/dev/null]) then From gcrypt-devel at mlists.thewrittenword.com Fri Oct 17 20:28:37 2008 From: gcrypt-devel at mlists.thewrittenword.com (Albert Chin) Date: Fri, 17 Oct 2008 13:28:37 -0500 Subject: Returning value in void function in 1.4.3 Message-ID: <20081017182837.GA2792@honinbu.il.thewrittenword.com> Building libgcrypt-1.4.3 with the Sun C compiler on Solaris 10: gmake[2]: Entering directory `/opt/build/libgcrypt-1.4.3/random' /opt/fsw/bash32/bin/bash ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -I/opt/TWWfsw/libgpgerror16/include -mr -Qn -xstrconst -xO2 -xtarget=ultra2 -m32 -xarch=sparcvis -c -o random.lo random.c mkdir .libs cc -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -I/opt/TWWfsw/libgpgerror16/include -mr -Qn -xstrconst -xO2 -xtarget=ultra2 -m32 -xarch=sparcvis -c random.c -KPIC -DPIC -o .libs/random.o "random.c", line 322: void function cannot return value cc: acomp failed for random.c gmake[2]: *** [random.lo] Error 1 gmake[2]: Leaving directory `/opt/build/libgcrypt-1.4.3/random' Patch attached. -- albert chin (china at thewrittenword.com) -------------- next part -------------- Index: random/random.c =================================================================== --- random/random.c.orig 2008-10-17 18:26:32.749302613 +0000 +++ random/random.c 2008-10-17 18:26:34.999740069 +0000 @@ -319,5 +319,5 @@ _gcry_random_deinit_external_test (void *context) { if (fips_mode ()) - return _gcry_rngfips_deinit_external_test (context); + _gcry_rngfips_deinit_external_test (context); } From gcrypt-devel at mlists.thewrittenword.com Fri Oct 17 21:21:45 2008 From: gcrypt-devel at mlists.thewrittenword.com (Albert Chin) Date: Fri, 17 Oct 2008 14:21:45 -0500 Subject: Duplicate const type specifier Message-ID: <20081017192145.GB2792@honinbu.il.thewrittenword.com> The Sun, HP, and IRIX C compilers complain (or error out) with a duplicate type specifier for the following in libgcrypt-1.4.3: const char const ... Patch attached. -- albert chin (china at thewrittenword.com) -------------- next part -------------- Index: cipher/ecc.c =================================================================== --- cipher/ecc.c.orig 2008-09-16 16:42:16.000000000 +0000 +++ cipher/ecc.c 2008-10-17 19:04:35.382534715 +0000 @@ -1189,7 +1189,7 @@ { gpg_err_code_t ec = 0; gcry_sexp_t l1; - static const char const names[] = "pabgnq"; + static const char names[] = "pabgnq"; gcry_mpi_t values[6]; int idx; Index: src/fips.c =================================================================== --- src/fips.c.orig 2008-09-18 10:20:27.000000000 +0000 +++ src/fips.c 2008-10-17 19:06:42.249867283 +0000 @@ -133,7 +133,7 @@ { FILE *fp; int saved_errno; - static const char const procfname[] = "/proc/sys/crypto/fips_enabled"; + static const char procfname[] = "/proc/sys/crypto/fips_enabled"; fp = fopen (procfname, "r"); if (fp) Index: src/hmac256.c =================================================================== --- src/hmac256.c.orig 2008-09-03 10:04:42.000000000 +0000 +++ src/hmac256.c 2008-10-17 19:08:57.031967959 +0000 @@ -526,7 +526,7 @@ const char * const desc; const char * const data; const char * const key; - const char const expect[32]; + const char expect[32]; } tv[] = { { "data-28 key-4", From gcrypt-devel at mlists.thewrittenword.com Fri Oct 17 21:24:26 2008 From: gcrypt-devel at mlists.thewrittenword.com (Albert Chin) Date: Fri, 17 Oct 2008 14:24:26 -0500 Subject: "initializer does not fit or is out of range" warnings with Sun C compiler Message-ID: <20081017192426.GC2792@honinbu.il.thewrittenword.com> The Sun C compiler gives the following warning when compiling src/hmac256.c: cc -DHAVE_CONFIG_H -I. -I.. -DSTANDALONE -mr -Qn -xstrconst -xO2 -xtarget=ultra2 -xarch=v8plusa -c -o hmac256-hmac256.o `test -f 'hmac256.c' || echo './'`hmac256.c "hmac256.c", line 535: warning: initializer does not fit or is out of range: 220 "hmac256.c", line 535: warning: initializer does not fit or is out of range: 193 "hmac256.c", line 535: warning: initializer does not fit or is out of range: 191 "hmac256.c", line 536: warning: initializer does not fit or is out of range: 149 "hmac256.c", line 536: warning: initializer does not fit or is out of range: 199 "hmac256.c", line 537: warning: initializer does not fit or is out of range: 157 "hmac256.c", line 537: warning: initializer does not fit or is out of range: 131 ... Should we change: const char expect[32] to: const unsigned char expect[32] -- albert chin (china at thewrittenword.com)