开发者

Make errors - can the gcc compiler warnings prevent a C file from being compiled into an object file?

开发者 https://www.devze.com 2022-12-30 03:25 出处:网络
I\'m trying to compile a wireless network card driver for my Linux box and I ran into a problem with the Make command. During the compilation process I norm开发者_运维百科ally see warnings on some of

I'm trying to compile a wireless network card driver for my Linux box and I ran into a problem with the Make command. During the compilation process I norm开发者_运维百科ally see warnings on some of the C files that being are compiled; despite the warnings these files were still able to be compiled to an object file.

When the Make process comes to a file called rtmp_wext.c however, the compiler generates a large number of warnings and then the whole Make process stops and returns an exit status of error 1, i.e. make: *** [rtmp_wext.o] Error 1. Usually I see an error with the C file for compilation to halt. This is the first time where it seems compiler warnings are preventing the file from being turned into an object file; is this possible or is something else the cause for the unsuccessful compilation?


If gcc is being passed the -Werror option it will; it causes warnings to be treated as errors, but they'll also be relabeled "error" instead of "warning", so if you're seeing "warning" that's not it. It's probably some other command make is running; you can try things like running it in verbose mode or just checking the Makefile to see what commands it's executing


You can tell Make to ignore the error by putting a '-' at the beginning of the command (after the tab). If this were your own code I'd advise you not to ignore a symptom, but I'm guessing you don't want to debug this code.

You say that you can compile rtmp_wext.o with a forest of warnings. I agree with derobert's comment; there may well be an error in there. If there is then there's no guarantee that rtmp_wext.o will actually work, and whether it works or not you should find the error message and tell whoever wrote the driver.

0

精彩评论

暂无评论...
验证码 换一张
取 消