Stopping multiple #warning messages in header files

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Stopping multiple #warning messages in header files

ソリューションへジャンプ
1,282件の閲覧回数
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.

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
886件の閲覧回数
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 件の賞賛
返信
2 返答(返信)
887件の閲覧回数
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 件の賞賛
返信
886件の閲覧回数
CarlFST60L
Senior Contributor II

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

0 件の賞賛
返信