C/C++ Compiler Invalidly Turning Warnings into Errors?

Sam Varshavchik mrsam at courier-mta.com
Thu Jan 15 12:38:25 UTC 2015


Stephen Morris writes:

> I have a driver for a wifi usb device that I need to compile because there  
> are no drivers in the kernel, which has been obtained from the vendor of the  
> device. When I attempt to compile the code the compile fails on the grounds  
> that some warnings are being translated into errors. From my perspective  
> these errors should not be happening because, when a debugging module wants  
> to time stamp the build, that is not an error and is perfectly acceptable.  
> How do I get the compiler to stop producing these errors. The messages I get  
> are listed below.

The makefile that's used to build this module explicitly specifies a  
compiler flag that makes this diagnostic an error. You can see it referenced  
in the error message, -Werror=date-time

So the answer to your question is very simple: it happens because that's  
what it does. I'm sure there's a way to override this flag. Look at the  
makefile, figure out where it specifies this flag, and take it out, if  
that's what you want to do. It might be possible to pass some flags on the  
command line to override it; can't really say without looking at the  
makefile.

If this driver is supposedly obtained from the vendor, and I'd think it's  
highly unlikely that Fedora manually patches the upstream kernel to add this  
flag, so the conclusion to draw from this is that the vendor has never  
tested their module with a kernel that's more recent than whatever is the  
first version of the kernel whose makefile was set up that way. I'd say that  
this compiler error is the least of your problems.

> Authentication requested [root] for make driver:
> make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/3.17.8-300.fc21.x86_64/build  
> M=/usr/local/downloads/dlink/RTL8812AU_linux_v4.3.2_11100.20140411/driver/rtl8812AU_linux_v4.3.2_11100.20140411  
> modules
> make[1]: Entering directory '/usr/src/kernels/3.17.8-300.fc21.x86_64'
>   CC [M]  
> /usr/local/downloads/dlink/RTL8812AU_linux_v4.3.2_11100.20140411/driver/rtl8812AU_linux_v4.3.2_11100.20140411/core/rtw_cmd.o
>   CC [M]  
> /usr/local/downloads/dlink/RTL8812AU_linux_v4.3.2_11100.20140411/driver/rtl8812AU_linux_v4.3.2_11100.20140411/core/rtw_security.o
>   CC [M]  
> /usr/local/downloads/dlink/RTL8812AU_linux_v4.3.2_11100.20140411/driver/rtl8812AU_linux_v4.3.2_11100.20140411/core/rtw_debug.o
> /usr/local/downloads/dlink/RTL8812AU_linux_v4.3.2_11100.20140411/driver/rtl8812AU_linux_v4.3.2_11100.20140411/core/rtw_debug.c:  
> In function ‘dump_drv_version’:
> /usr/local/downloads/dlink/RTL8812AU_linux_v4.3.2_11100.20140411/driver/rtl8812AU_linux_v4.3.2_11100.20140411/core/rtw_debug.c: 
> 66:64: error: macro "__DATE__" might prevent reproducible builds [- 
> Werror=date-time]
>   DBG_871X_SEL_NL(sel, "build time: %s %s\n", __DATE__, __TIME__);
>                                                                 ^
> /usr/local/downloads/dlink/RTL8812AU_linux_v4.3.2_11100.20140411/driver/rtl8812AU_linux_v4.3.2_11100.20140411/core/rtw_debug.c: 
> 66:1: error: macro "__TIME__" might prevent reproducible builds [- 
> Werror=date-time]
>   DBG_871X_SEL_NL(sel, "build time: %s %s\n", __DATE__, __TIME__);
>  ^
> /usr/local/downloads/dlink/RTL8812AU_linux_v4.3.2_11100.20140411/driver/rtl8812AU_linux_v4.3.2_11100.20140411/core/rtw_debug.c: 
> 66:1: error: macro "__DATE__" might prevent reproducible builds [- 
> Werror=date-time]
> /usr/local/downloads/dlink/RTL8812AU_linux_v4.3.2_11100.20140411/driver/rtl8812AU_linux_v4.3.2_11100.20140411/core/rtw_debug.c: 
> 66:1: error: macro "__TIME__" might prevent reproducible builds [- 
> Werror=date-time]
> /usr/local/downloads/dlink/RTL8812AU_linux_v4.3.2_11100.20140411/driver/rtl8812AU_linux_v4.3.2_11100.20140411/core/rtw_debug.c: 
> 66:1: error: macro "__DATE__" might prevent reproducible builds [- 
> Werror=date-time]
> /usr/local/downloads/dlink/RTL8812AU_linux_v4.3.2_11100.20140411/driver/rtl8812AU_linux_v4.3.2_11100.20140411/core/rtw_debug.c: 
> 66:1: error: macro "__TIME__" might prevent reproducible builds [- 
> Werror=date-time]
> cc1: some warnings being treated as errors
> scripts/Makefile.build:257: recipe for target  
> '/usr/local/downloads/dlink/RTL8812AU_linux_v4.3.2_11100.20140411/driver/rtl8812AU_linux_v4.3.2_11100.20140411/core/rtw_debug.o'  
> failed
> make[2]: ***  
> [/usr/local/downloads/dlink/RTL8812AU_linux_v4.3.2_11100.20140411/driver/rtl8812AU_linux_v4.3.2_11100.20140411/core/rtw_debug.o]  
> Error 1
> Makefile:1377: recipe for target  
> '_module_/usr/local/downloads/dlink/RTL8812AU_linux_v4.3.2_11100.20140411/driver/rtl8812AU_linux_v4.3.2_11100.20140411'  
> failed
> make[1]: ***  
> [_module_/usr/local/downloads/dlink/RTL8812AU_linux_v4.3.2_11100.20140411/driver/rtl8812AU_linux_v4.3.2_11100.20140411]  
> Error 2
> make[1]: Leaving directory '/usr/src/kernels/3.17.8-300.fc21.x86_64'
> Makefile:1350: recipe for target 'modules' failed
> make: *** [modules] Error 2
> ##################################################
> Compile make driver error: 2
> Please check error Mesg
> ##################################################
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.fedoraproject.org/pipermail/users/attachments/20150115/78a1149f/attachment.sig>


More information about the users mailing list