How to remove -Werror during compilation in Developer Studio


#1

I am testing the sample code.
But it is quite troublesome to have the -Werror option for compilation.
Any idea to remove this option in Developer studio?

11:20:33 **** Incremental Build of configuration Target_Legato_Debug for project commandLine ****
make all 
cd ..;mkapp -t ar7 -o Target_Legato_Debug -w Target_Legato_Debug -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/dataConnectionService -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/secureStorage -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/powerMgr -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/monitoring -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/cellNetService -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/audio -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/supervisor -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/modemServices -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/airVantage -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/voiceCallService -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/positioning -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/build/ar7/airvantage/runtime/itf -C -g -L -g commandLine.adef --append-to-version=20150624112033
./fileInfo.c: In function '_fileInfo_exe_COMPONENT_INIT':
./fileInfo.c:411:6: error: unused variable 'i' [-Werror=unused-variable]
cc1: all warnings being treated as errors
** ERROR: Command execution failure, exit code: 256.
make: *** [app] Error 1

11:20:33 Build Finished (took 165ms)

#2

mkapp builder indeed turns on -Werror option by default.
You can negate this option for some (or all) warnings by adding a -Wno-error=all option.
(You can add it to mkapp command line in Project Properties > C/C++ Build > Settings)


#3

Thx for your reply, but it is not working for me…
I put the “-Wno-error=all” in Project Properties > C/C++ Build > Settings-> mkapp Tool -> C build option -> Additional compiler option
Any idea?

###########################################
07:30:08 **** Incremental Build of configuration Target_Legato_Debug for project HelloWorld ****
make all
cd …;mkapp -t ar7 -o Target_Legato_Debug -w Target_Legato_Debug -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/dataConnectionService -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/secureStorage -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/powerMgr -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/monitoring -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/cellNetService -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/audio -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/supervisor -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/modemServices -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/airVantage -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/voiceCallService -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/interfaces/positioning -i /home/owner/.devstudio/packages/legato.framework.15.1.0.Beta/resources/legato/build/ar7/airvantage/runtime/itf -C -g -L -g -C -Wno-error=all HelloWorld.adef --append-to-version=20150625073008
./helloWorld.c: In function ‘_helloWorld_exe_COMPONENT_INIT’:
./helloWorld.c:10:5: error: unused variable ‘i’ [-Werror=unused-variable]
cc1: all warnings being treated as errors
** ERROR: Command execution failure, exit code: 256.
make: *** [app] Error 1


#4

Hum, sounds like using “all” keyword isn’t doing anything here…
Alternatively, you can specify warning types one by one (e.g. in your case: -Wno-error=unused-variable)


#5

Thx for your help!
It works now!!!
Thx