[BUG]: Mysterious behavior with # in command line arguments
See original GitHub issueDescribe the bug
Consider the following code:
#warning "what?"
#pragma message("whattt??")
In Clang, you can silence the first diagnostic with -Wno-#warnings
and the second with -Wno-#pragma-messages
. Additionally, you can upgrade them into errors via -Werror=#warnings
and -Werror=#pragma-messages
.
However, in CE, you… can’t? Can? A bit of both? I honestly am not certain what’s going on.
Steps to reproduce
On the site, select Clang as the compiler, enter the code above.
- Add
-Wno-#warnings -Wno-#pragma-messages
as the command line arguments for the compiler. Notice that the diagnostics are not suppressed. Try it again on a native client and they will be. - Delete the old command line arguments and add
-Werror=#warnings -Werror=#pragma-messages
instead. Notice that the#warning
was upgraded into an error, but the#pragma message
was not. - Scratch your head and wonder how that happens. 😃
Expected behavior
For the first step, I’d expect both diagnostics to be suppressed same as on the command line. For the second step, I’d expect both diagnostics to be upgraded to an error. This is the behavior you get from the command line.
Reproduction link
https://godbolt.org/z/68Kej8Pf7
Screenshots
Not applicable
Operating System
No response
Browser version
No response
Issue Analytics
- State:
- Created a year ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Strange behaviour of command line arguments in iOS ...
It checks the number of command line arguments. If it is larger than 3 prints a message to console and to a file....
Read more >1724251 - Command line arguments handled in "command ...
We are using the same API in the "command-line-startup" observer as in "handle" so it seems strange that it doesn't have the same...
Read more >[feature request] ln with command line arguments in reverse o
The issue simply is with the mental model made when approaching the "ln" command. In French, the usual way to say when creating...
Read more >Strange behavior of argv when passing string containing "!!!!"
A problem only arises when I use more than one exclamation mark at the end of the string I want to pass as...
Read more >bash function arguments strange behaviour
... process the function's command line in repeated invocations of it. ... When an option requires an argument, getopts places that argument ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
quoteParse is the culprit, it turns everything after # into an object https://www.npmjs.com/package/shell-quote
it sees it as a comment
confirmed with a unittest its indeed the splitArguments function