wmaillard / shellinabox

Automatically exported from code.google.com/p/shellinabox
Other
0 stars 0 forks source link

Compilation fails b/c of -Werror #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. download
2. ./configure
3. make

What is the expected output? What do you see instead?

/bin/bash ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -g
-std=gnu99 -Wall -Werror -Os -g -O2 -MT httpconnection.lo -MD -MP -MF
.deps/httpconnection.Tpo -c -o httpconnection.lo `test -f
'libhttp/httpconnection.c' || echo './'`libhttp/httpconnection.c
 gcc -DHAVE_CONFIG_H -I. -g -std=gnu99 -Wall -Werror -Os -g -O2 -MT
httpconnection.lo -MD -MP -MF .deps/httpconnection.Tpo -c
libhttp/httpconnection.c  -fPIC -DPIC -o .libs/httpconnection.o
cc1: warnings being treated as errors
libhttp/httpconnection.c: In function ‘httpHandleCommand’:
libhttp/httpconnection.c:554: error: format not a string literal and no
format arguments
libhttp/httpconnection.c:557: error: format not a string literal and no
format arguments
libhttp/httpconnection.c:571: error: format not a string literal and no
format arguments
libhttp/httpconnection.c:608: error: format not a string literal and no
format arguments
libhttp/httpconnection.c: In function ‘httpParseCommand’:
libhttp/httpconnection.c:637: error: format not a string literal and no
format arguments
libhttp/httpconnection.c: In function ‘httpParseHeaders’:
libhttp/httpconnection.c:784: error: format not a string literal and no
format arguments
libhttp/httpconnection.c: In function ‘httpHandleConnection’:
libhttp/httpconnection.c:943: error: format not a string literal and no
format arguments
make[1]: *** [httpconnection.lo] Error 1
make[1]: Leaving directory `/home/biehl/devel/progs/shellinabox-2.4'
make: *** [all] Error 2

What version of the product are you using? On what operating system?

Ubuntu 8.10, gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12) 

Please provide any additional information below.

Workaround as before, more errors seem to hide after the first one above
(is there any reason to release with -Werror?)

Original issue reported on code.google.com by anders.n...@gmail.com on 14 Feb 2009 at 5:01

GoogleCodeExporter commented 8 years ago
with shellinabox-2.4.tar.gz

Original comment by anders.n...@gmail.com on 14 Feb 2009 at 5:02

GoogleCodeExporter commented 8 years ago
In general -Werror is a great option as it forces code to be written more 
cleanly and
portably. In most cases, compilers only warn about code that is rather suspect. 
So,
it makes sense to avoid these issues.

The problem happens when compilers invent new experimental and aggressive 
warnings,
and distributions then decide to crank up the default warning level past the
recommended settings. Ubuntu for some reason decides to ship with "-Wformat=2" 
by
default. Normally, "gcc" does not turn on this warning, as it is known to 
generate a
large number of false positives (as you just discovered, yourself).

I implemented some work-arounds that should tell the compiler that no warning is
necessary. I tested compilation with "-Wformat=2" and it now passes. This code 
is now
in Subversion.

But it is possible that Ubuntu turned on some other aggressive warnings that 
trigger
in other parts of the code. If so, please let me know and I'll add work-arounds 
for
those, too.

Original comment by zod...@gmail.com on 15 Feb 2009 at 8:10

GoogleCodeExporter commented 8 years ago

Original comment by zod...@gmail.com on 15 Feb 2009 at 8:10