"initializer does not fit or is out of range" warnings with Sun C compiler

Albert Chin gcrypt-devel at mlists.thewrittenword.com
Fri Oct 17 21:24:26 CEST 2008


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)



More information about the Gcrypt-devel mailing list