User forums > Using Code::Blocks

[SOLVED] How to suppress a specific warning ?

<< < (2/2)

stahta01:
You need to use the correct flag for your compiler!

GCC tends to use "-Wno-flag" to disable "-Wflag"; but, that may not always be true.

Tim S.

R1S8K:


these are the warnings that work on my compiler GCC, if I check a box it affects the code compilation.

But


--- Code: ----Wuninitialized
--- End code ---

isn't with them. I don't know where it came from ?

oBFusCATed:
Repeating the message won't increase the changes of your success.
Especially if you ignore the information given by others (in this particular case the post by Stahta01).

If you've added an option you have to rebuild your program.
If it doesn't work inspect the build log.
If the option is not there inspect the project, target and global complier options.
Make corrections and repeat.

R1S8K:

--- Quote from: oBFusCATed on January 15, 2021, 02:28:52 am ---
If it doesn't work inspect the build log.


--- End quote ---

Thanks for informing this point, if you didn't tell me, I wouldn't know about inspecting the log result.

I actually found the included flag with the log, I don't know if it's working to suppress the warning, because I declared a variable and didn't initialize it; with and without the inclusion of this flag but didn't get the warning as before.


--- Code: ---gcc.exe -Wall -g -Wuninitialized -w  -c F:\Programming\programming_dev\desktop_programming\C\sketches\fun_ptr_test\main.c -o obj\Debug\main.o
gcc.exe -Wall -g -Wuninitialized -w  -c F:\Programming\programming_dev\desktop_programming\C\sketches\fun_ptr_test\modules.c -o obj\Debug\modules.o
gcc.exe -Wall -g -Wuninitialized -w  -c F:\Programming\programming_dev\desktop_programming\C\sketches\fun_ptr_test\task_manager.c -o obj\Debug\task_manager.o
--- End code ---

Anyway I learned something today about how to deal with certain flag, and there's a lot to learn too.

Thanks all :)

stahta01:
FYI: Option "-w" stops all warnings and should never be used by a newbie programmer!!!!

Tim S.

Navigation

[0] Message Index

[*] Previous page

Go to full version