Tuesday, July 31, 2012

Fighting make error: not protecting function: no buffer at least 8 bytes long

Attempting to build monetdb from source. The mercurial checkout date is not today but somewhere around start of July.

Getting the following error saying something like:
cc1: warnings being treated as errors - this is due to -Werror flag to gcc


inet.c: In function ‘INET_comp_CW’:
inet.c:323: error: not protecting function: no buffer at least 8 bytes long
inet.c: In function ‘INETbroadcast’:
inet.c:423: error: not protecting function: no buffer at least 8 bytes long
inet.c: In function ‘INETnetmask’:
inet.c:523: error: not protecting function: no buffer at least 8 bytes long
inet.c: In function ‘INETnetwork’:
inet.c:593: error: not protecting function: no buffer at least 8 bytes long
inet.c: In function ‘INETabbrev’:
inet.c:660: error: not protecting function: no buffer at least 8 bytes long
make[7]: *** [libatoms_la-inet.lo] Error 1
 - due to -fstack-protector-all -Wstack-protector flags to gcc. For more info on stack protector feature refer http://stackoverflow.com/questions/1629685/when-and-how-to-use-gccs-stack-protection-feature


The explanation at http://ubuntuforums.org/showthread.php?t=1612849 was sufficient for fixing.

Went to those line numbers.  They were the entry point of the reported functions.
Found unsigned char[4] local variables. Changed them to char[8].

Owned it.

Regards,
Tapomay.

No comments:

Post a Comment