Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Unable to get GCC to treat "implicit function delaration" as an error

2011-01-26 by Chuck Hackett

I ended up chasing a bug because I had not noticed that one out of sixteen compiles
in a rebuild issued warnings about implicit function declarations which, of course,
caused an invalid calling sequence to be emitted.  

I thought I had set up the compiler options to treat this as an error but apparently
not.

I've re-read the gcc manual and searched the web but I can't figure out what I'm
doing wrong.

The following compiler command (WinAVR 20200110):

avr-gcc.exe -mmcu=atmega32 -Wall -fms-extensions
-Werror-implicit-function-declaration -DF_CPU=14745600UL  -g  -std=c99
-I..\BC002_MultiTaskCB -IC:\FreeRTOSV6.1.0\Source\include
-IC:\FreeRTOSV6.1.0\Source\portable\GCC\ATMega323 -ICommon_include
-IC:\WinAVR-20071221\avr\include  -c TrackIn.c -o obj\Debug\TrackIn.o

Produces the following output:

TrackIn.c: In function 'TrackIn__XmitStatus':
TrackIn.c:41: warning: implicit declaration of function 'CAN_XmitNM'
TrackIn.c: In function 'TrackIn__Init':
TrackIn.c:242: warning: implicit declaration of function 'CAN_XmitObjectStart'

And did not generate an error.

It was my understanding that the "-Werror-implicit-function-declaration" compiler
option would cause the warning to be turned into an error even in the presence of
the "-Wall" option.  I also tried "-Werror=implicit-function-declaration" with no
success.

Any idea what I'm doing wrong?

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.