Skip to content

Commit 68546f4

Browse files
author
jantje
committed
#1333 take the warning level setting into account properly
1 parent c98adbf commit 68546f4

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

io.sloeber.core/config/pre_processing_platform_default.txt

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ runtime.ide.version=10812
88
build.system.path=${referenced.core.path}${DirectoryDelimiter}system
99
serial.port=${com_port}
1010
build.project_name=${ProjName}
11+
#make sure we have default compiling warning commands
12+
compiler.warning_flags.none=-w
13+
compiler.warning_flags.more=-Wall
14+
compiler.warning_flags.all=-Wall -Wextra
1115

1216

1317

io.sloeber.core/src/io/sloeber/core/api/CompileDescription.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ public class CompileDescription {
2424
private String my_Link_CompileOptions = new String();
2525
private String my_All_CompileOptions = new String();
2626

27-
private static final String ENV_KEY_WARNING_LEVEL_OFF = "compiler.warning_flags"; //$NON-NLS-1$
28-
private static final String ENV_KEY_WARNING_LEVEL_ON = "${compiler.warning_flags_all}"; //$NON-NLS-1$
27+
private static final String ENV_KEY_WARNING_LEVEL = "compiler.warning_flags"; //$NON-NLS-1$
28+
private static final String ENV_KEY_WARNING_LEVEL_ALL = "${compiler.warning_flags.all}"; //$NON-NLS-1$
29+
private static final String ENV_KEY_WARNING_LEVEL_NONE = "${compiler.warning_flags.none}"; //$NON-NLS-1$
30+
2931
private static final String SLOEBER_ADDITIONAL_COMPILE_OPTIONS = ENV_KEY_SLOEBER_START
3032
+ "extra.compile"; //$NON-NLS-1$
3133
private static final String SLOEBER_ADDITIONAL_C_COMPILE_OPTIONS = ENV_KEY_SLOEBER_START
@@ -137,7 +139,9 @@ public Map<String, String> getEnvVars() {
137139
ret.put(SLOEBER_ALL_COMPILE_OPTIONS, this.my_All_CompileOptions);
138140

139141
if (this.isWarningLevel()) {
140-
ret.put(ENV_KEY_WARNING_LEVEL_OFF, ENV_KEY_WARNING_LEVEL_ON);
142+
ret.put(ENV_KEY_WARNING_LEVEL, ENV_KEY_WARNING_LEVEL_ALL);
143+
} else {
144+
ret.put(ENV_KEY_WARNING_LEVEL, ENV_KEY_WARNING_LEVEL_NONE);
141145
}
142146
if (this.myAlternativeSizeCommand) {
143147
ret.put(SLOEBER_SIZE_SWITCH, makeEnvironmentVar(SLOEBER_SIZE_COMMAND));

0 commit comments

Comments
 (0)