Any explanation why is that?
-
-
-
In C, a default case is not required. Also in C, you can define "goto" labels using the same syntax. Thus "defualt" is defined as a C label and no default case is specified when the code compiles.
- Još 4 druga odgovora
Novi razgovor -
-
-
gcc and clang will warn about the unused goto label 'defualt' if you use -Wall (and i think there is also an option to enable a warning specifically about unused labels). msvc issues the same warning with /W3
-
related: sometimes i like to write: todo: // note about thing to do... ... so that my editor will snap back to the location of the unused label 'todo' when i recompile
Kraj razgovora
Novi razgovor -
-
-
Hopefully some static code analysis tool reports 'missing default', or a compiler warning
- Još 1 odgovor
Novi razgovor -
-
-
How‘s the overflow caused? _IOC_SIZE returning crap for undefined commands?
-
_IOC_SIZE is just a macro which selects some bits from the command, which is usermode-controlled. You can specify a bigger size than expected by this function (assuming you bypassed the buggy switch). See https://elixir.bootlin.com/linux/v5.4.1/source/include/uapi/asm-generic/ioctl.h#L97 ….
- Još 1 odgovor
Novi razgovor -
-
-
I first thought “WTF this compiles?” but then saw it. -Wunused-label ought to catch it, though, and is enabled by -Wall.
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.