Skip to content

Commit 50cd04d

Browse files
committed
Revert "Warn when setting used on the command line more than once (#21464)"
This reverts commit 696b4f2.
1 parent cb0d16c commit 50cd04d

File tree

6 files changed

+10
-20
lines changed

6 files changed

+10
-20
lines changed

emcc.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,6 @@ def phase_parse_arguments(state):
684684
for s in settings_changes:
685685
key, value = s.split('=', 1)
686686
key, value = normalize_boolean_setting(key, value)
687-
old_value = user_settings.get(key)
688-
if old_value and old_value != value:
689-
diagnostics.warning('unused-command-line-argument', f'-s{key} specified multiple times. Ignoring previous value (`{old_value}`)')
690687
user_settings[key] = value
691688

692689
# STRICT is used when applying settings so it needs to be applied first before

test/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ def setUp(self):
903903
# For historical reasons emcc compiles and links as C++ by default.
904904
# However we want to run our tests in a more strict manner. We can
905905
# remove this if the issue above is ever fixed.
906-
self.set_setting('DEFAULT_TO_CXX', 0)
906+
self.set_setting('NO_DEFAULT_TO_CXX')
907907
self.ldflags = []
908908
# Increate stack trace limit to maximise usefulness of test failure reports
909909
self.node_args = ['--stack-trace-limit=50']

test/test_browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4773,7 +4773,7 @@ def test_pthread_hello_thread(self, opts, modularize):
47734773
'modularize': (['-sMODULARIZE', '-sEXPORT_NAME=MyModule'],),
47744774
'O3': (['-O3'],),
47754775
'O3_modularize': (['-O3', '-sMODULARIZE', '-sEXPORT_NAME=MyModule'],),
4776-
'O3_modularize_MINIMAL_RUNTIME_2': (['-O3', '-sMODULARIZE', '-sEXPORT_NAME=MyModule', '-sMINIMAL_RUNTIME=2', '-Wno-unused-command-line-argument'],),
4776+
'O3_modularize_MINIMAL_RUNTIME_2': (['-O3', '-sMODULARIZE', '-sEXPORT_NAME=MyModule', '-sMINIMAL_RUNTIME=2'],),
47774777
})
47784778
def test_minimal_runtime_hello_thread(self, opts):
47794779
self.btest_exit('pthread/hello_thread.c', args=['--closure=1', '-sMINIMAL_RUNTIME', '-pthread'] + opts)

test/test_core.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9125,9 +9125,8 @@ def test_pthread_create_embind_stack_check(self):
91259125
# embind should work with stack overflow checks (see #12356)
91269126
self.set_setting('STACK_OVERFLOW_CHECK', 2)
91279127
self.set_setting('EXIT_RUNTIME')
9128-
self.set_setting('DEFAULT_TO_CXX')
91299128
self.emcc_args += ['-lembind']
9130-
self.do_run_in_out_file_test('core/pthread/create.c')
9129+
self.do_run_in_out_file_test('core/pthread/create.c', emcc_args=['-sDEFAULT_TO_CXX'])
91319130

91329131
@node_pthreads
91339132
def test_pthread_exceptions(self):

test/test_other.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7815,10 +7815,6 @@ def test_dash_s_bad_json_types(self):
78157815
err = self.expect_fail([EMCC, test_file('hello_world.c'), '-sEXPORTED_FUNCTIONS=[{"a":1}]'])
78167816
self.assertContained("list members in settings must be strings (not $<class 'dict'>)", err)
78177817

7818-
def test_dash_s_repeated(self):
7819-
err = self.expect_fail([EMCC, '-Werror', test_file('hello_world.c'), '-sEXPORTED_FUNCTIONS=foo', '-sEXPORTED_FUNCTIONS=bar'])
7820-
self.assertContained('emcc: error: -sEXPORTED_FUNCTIONS specified multiple times. Ignoring previous value (`foo`) [-Wunused-command-line-argument]', err)
7821-
78227818
def test_zeroinit(self):
78237819
create_file('src.c', r'''
78247820
#include <stdio.h>
@@ -12023,23 +12019,21 @@ def test_default_to_cxx(self):
1202312019

1202412020
@parameterized({
1202512021
'': ([],),
12026-
'minimal': (['-sMINIMAL_RUNTIME'],),
12022+
'minimal': (['-sMINIMAL_RUNTIME', '-sSUPPORT_ERRNO'],),
1202712023
})
1202812024
def test_support_errno(self, args):
1202912025
self.emcc_args += args + ['-sEXPORTED_FUNCTIONS=_main,___errno_location', '-Wno-deprecated']
1203012026

12031-
self.do_other_test('test_support_errno.c', emcc_args=['-sSUPPORT_ERRNO'])
12032-
size_enabled = os.path.getsize('test_support_errno.js')
12027+
self.do_other_test('test_support_errno.c')
12028+
size_default = os.path.getsize('test_support_errno.js')
1203312029

1203412030
# Run the same test again but with SUPPORT_ERRNO disabled. This time we don't expect errno
1203512031
# to be set after the failing syscall.
12036-
self.do_other_test('test_support_errno.c', emcc_args=['-sSUPPORT_ERRNO=0'], out_suffix='_disabled')
12032+
self.emcc_args += ['-sSUPPORT_ERRNO=0']
12033+
self.do_other_test('test_support_errno.c', out_suffix='_disabled')
1203712034

1203812035
# Verify the JS output was smaller
12039-
size_disabled = os.path.getsize('test_support_errno.js')
12040-
print(size_enabled)
12041-
print(size_disabled)
12042-
self.assertLess(size_disabled, size_enabled)
12036+
self.assertLess(os.path.getsize('test_support_errno.js'), size_default)
1204312037

1204412038
def test_assembly(self):
1204512039
self.run_process([EMCC, '-c', test_file('other/test_asm.s'), '-o', 'foo.o'])

test/test_sockets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def test_nodejs_sockets_echo_subprotocol(self):
332332
})
333333
def test_websocket_send(self, args):
334334
with NodeJsWebSocketEchoServerProcess():
335-
self.btest_exit('websocket/test_websocket_send.c', args=['-lwebsocket', '-sWEBSOCKET_DEBUG'] + args)
335+
self.btest_exit('websocket/test_websocket_send.c', args=['-lwebsocket', '-sNO_EXIT_RUNTIME', '-sWEBSOCKET_DEBUG'] + args)
336336

337337
# Test that native POSIX sockets API can be used by proxying calls to an intermediate WebSockets
338338
# -> POSIX sockets bridge server

0 commit comments

Comments
 (0)