Simple But Dangerous Implicit of GCC

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable
        Hello everyone   
I find a dangerous situation at GCC default.   
Take a look my bundle, Debug.c line 9~16   
Some function is nowhere but hex file has made.   
This GCC default is   
[ -Wimplicit-function-declaration ]   
It not rise an error   
I strongly recommand   
[ -Werror-implicit-function-declaration ]   
   
ByTheWay, How to do with "dummy" ??   
0 Likes
3 Replies
lock attach
Attachments are accessible only for community members.
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

What about thaking the warnings seriously?

   

 

   

Bob

0 Likes
Anonymous
Not applicable
        No, No   
If subroutines is not existed but hex code will generated.   
The PSoC work with no these subroutines.   
OK?   
0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

You don't get an error because 'ConstCopy' is not actually used. An implicit declaration is not really a compiler error because most times the compiler can infer the method definition properly from its usage.

   

You will get an error about the undefined method from the linker. But since the linker doesn't need the 'ConstCopy' method, it doesn't complain. And this is because you don't call the 'DebugCommand' method, so it gets removed by the linker.

   

If you call the debug method, you will get an error as you expect.

0 Likes