Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable a specific gcc warnings for a specific directory or file? [duplicate]

Possible Duplicate:
Selectively disable GCC warnings for only part of a translation unit?

How to enable a specific gcc warnings for a specific directory or file ?

I want to enable -Wsign-conversion for my own files not for any other system headers

like image 780
Behrouz.M Avatar asked Oct 24 '25 10:10

Behrouz.M


1 Answers

This line should do it: (see here)
#pragma GCC diagnostic warning "-Wsign-conversion"

Put it in the affected files or in a header that is included in all you files

like image 70
king_nak Avatar answered Oct 26 '25 01:10

king_nak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!