Juicy
Juicy

Reputation: 12510

Stop make from treating warnings as errors

I'm trying to make the little proxy server tcproxy:

user@localhost:tcproxy $ make
cd src && make all
make[1]: Entering directory '/home/user/Downloads/tcproxy/src'
    CC anet.o
In file included from /usr/include/sys/types.h:25:0,
                 from anet.c:33:
/usr/include/features.h:148:3: error: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Werror=cpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
   ^
cc1: all warnings being treated as errors
Makefile:26: recipe for target 'anet.o' failed
make[1]: *** [anet.o] Error 1
make[1]: Leaving directory '/home/user/Downloads/tcproxy/src'
Makefile:10: recipe for target 'all' failed
make: *** [all] Error 2

Compilation is failing because all warnings are being treated as errors

It hasn't been updated in two years and it appears the warning is just from something being deprecated, but I'm hoping it should work nonetheless.

I've Googled how to stop all warnings being treated as errors; someone suggests using -Wno-error but that made no difference in my case.

How can I force the compilation here?

Note

The Makefile simply contains:

#
# tcproxy - Makefile
#
# Author: dccmx <[email protected]>
#

default: all

.DEFAULT:
    cd src && $(MAKE) $@

Upvotes: 1

Views: 3594

Answers (2)

tux3
tux3

Reputation: 7320

In src/Makefile there is a line defining :

CFLAGS_GEN = -Wall -Werror -g $(CFLAGS)

Remove the -Werror and the warning you're getting should get ignored.

Upvotes: 4

MadScientist
MadScientist

Reputation: 100836

These are compiler options, not make options, to be clear.

You need to find the options that you use when make invokes your compiler. Look in your makefile for the option -Werror, and remove it from whatever variable it's contained in (probably CFLAGS or some variation).

Upvotes: 0

Related Questions