openssl: Strict C90 CFLAGS results in sha.h:91 ISO C90 does not support long long
Somewhat loosely related to https://github.com/openssl/openssl/issues/8048 wherein we all agree that the codebase is compliant with C90. However while trying a build with strict C90 flags I see :
titan# make
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
"-oMakefile" crypto/include/internal/bn_conf.h.in > crypto/include/internal/bn_conf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
"-oMakefile" crypto/include/internal/dso_conf.h.in > crypto/include/internal/dso_conf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
"-oMakefile" include/openssl/opensslconf.h.in > include/openssl/opensslconf.h
/usr/bin/make depend && /usr/bin/make _all
make[1]: Entering directory '/opt/bw/build/openssl-1.1.1d_debian_sid_i686_5.3.7-genunix.001'
make[1]: Leaving directory '/opt/bw/build/openssl-1.1.1d_debian_sid_i686_5.3.7-genunix.001'
make[1]: Entering directory '/opt/bw/build/openssl-1.1.1d_debian_sid_i686_5.3.7-genunix.001'
/usr/bin/gcc-9 -I. -Iinclude -fPIC -std=c90 -pedantic -pedantic-errors -Wpedantic -fno-builtin -march=i686 -mtune=i686 -Wl,-rpath=/opt/bw/lib,--enable-new-dtags -mpc80 -pthread -Wa,--noexecstack -std=c90 -pedantic -pedantic-errors -Wpedantic -fno-builtin -march=i686 -mtune=i686 -Wl,-rpath=/opt/bw/lib,--enable-new-dtags -mpc80 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSLDIR="\"/opt/bw/ssl\"" -DENGINESDIR="\"/opt/bw/lib/engines-1.1\"" -DNDEBUG -I/opt/bw/include -D_POSIX_PTHREAD_SEMANTICS -D_TS_ERRNO -D_LARGEFILE64_SOURCE -MMD -MF apps/app_rand.d.tmp -MT apps/app_rand.o -c -o apps/app_rand.o apps/app_rand.c
In file included from include/openssl/x509.h:30,
from apps/apps.h:26,
from apps/app_rand.c:10:
include/openssl/sha.h:91:36: error: ISO C90 does not support 'long long' [-Wlong-long]
91 | # define SHA_LONG64 unsigned long long
| ^~~~
include/openssl/sha.h:96:5: note: in expansion of macro 'SHA_LONG64'
96 | SHA_LONG64 h[8];
| ^~~~~~~~~~
include/openssl/sha.h:91:36: error: ISO C90 does not support 'long long' [-Wlong-long]
91 | # define SHA_LONG64 unsigned long long
| ^~~~
include/openssl/sha.h:97:5: note: in expansion of macro 'SHA_LONG64'
97 | SHA_LONG64 Nl, Nh;
| ^~~~~~~~~~
include/openssl/sha.h:91:36: error: ISO C90 does not support 'long long' [-Wlong-long]
91 | # define SHA_LONG64 unsigned long long
| ^~~~
include/openssl/sha.h:99:9: note: in expansion of macro 'SHA_LONG64'
99 | SHA_LONG64 d[SHA_LBLOCK];
| ^~~~~~~~~~
make[1]: *** [Makefile:708: apps/app_rand.o] Error 1
make[1]: Leaving directory '/opt/bw/build/openssl-1.1.1d_debian_sid_i686_5.3.7-genunix.001'
make: *** [Makefile:174: all] Error 2
Command exited with non-zero status 2
titan#
Seems reasonable to re-try that build with no CFLAGS of any particular compliance flavour however I am curious why C90 clean code would have any issue whatsoever?
Dennis
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 15 (7 by maintainers)
I think the underlying discussion here is whether or not you have an actual system where we have an issue compiling that we need to address or if this is simply an academic exercise to see what is in place.
We do stick to C90 with certain “extensions” on various platforms to support things like an 8-byte data type as you have noted.
If there is a platform which we aren’t able to compile on to support we are interested in being aware of that and will look at whether or not something needs addressing. We do not have a policy of strict C90 conformance - we stick to the C90 dialect of C for the main code - but do support extensions to allow beyond C90 usage on the range of platforms without adopting the general language extensions of C99.