Stopping multiple #warning messages in header files

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Stopping multiple #warning messages in header files

Jump to solution
748 Views
CarlFST60L
Senior Contributor II

Hi,

 

I have some header files with #warnings, when I compile, the warning appears once for every source file which includes the header.

 

Is there a way to stop the warning being shown more than once?

 

Obviously #pragma once and #ifndef are all scope dependent, therefore, do not stop the repeat messages.

 

Carl.

Labels (1)
0 Kudos
1 Solution
352 Views
CrasyCat
Specialist III

Hello

 

The compiler is processing one compilation unit (Source file + all files included in there) at a time.

So the warning will be generated each time you have the corresponding .h file included in a C file.

 

There is no way to print a warning only once during a full build.

 

CrasyCat

View solution in original post

0 Kudos
2 Replies
353 Views
CrasyCat
Specialist III

Hello

 

The compiler is processing one compilation unit (Source file + all files included in there) at a time.

So the warning will be generated each time you have the corresponding .h file included in a C file.

 

There is no way to print a warning only once during a full build.

 

CrasyCat

0 Kudos
352 Views
CarlFST60L
Senior Contributor II

Thanks, I was thinking there may be some 'trick' that I wasnt aware of :smileyhappy:

0 Kudos