Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/parseTools.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export function preprocess(filename) {
showStack.pop();
} else if (first === '#warning') {
if (showCurrentLine()) {
printErr(
warn(
`${filename}:${i + 1}: #warning ${trimmed.substring(trimmed.indexOf(' ')).trim()}`,
);
}
Expand Down
7 changes: 7 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -4919,6 +4919,13 @@ def test_jslib_warnings(self):
self.assertNotContained('This warning should not be present!', proc.stderr)
self.assertContained('warning_in_js_libraries.js:5: #warning This is a warning string!', proc.stderr)
self.assertContained('warning_in_js_libraries.js:7: #warning This is a second warning string!', proc.stderr)
self.assertContained('emcc: warning: warnings in JS library compilation [-Wjs-compiler]', proc.stderr)

err = self.expect_fail([EMCC, test_file('hello_world.c'), '--js-library', test_file('warning_in_js_libraries.js'), '-Werror'])
self.assertNotContained('This warning should not be present!', err)
self.assertContained('warning_in_js_libraries.js:5: #warning This is a warning string!', err)
self.assertContained('warning_in_js_libraries.js:7: #warning This is a second warning string!', err)
self.assertContained('emcc: error: warnings in JS library compilation [-Wjs-compiler] [-Werror]', err)

# Tests using the #error directive in JS library files
def test_jslib_errors(self):
Expand Down