Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22006

How to use __attribute__((fallthrough)) correctly in gcc

$
0
0

Code sample:

int main(int argc, char **argv){    switch(argc)    {    case 0:        argc = 5;        __attribute__((fallthrough));    case 1:        break;    }}

Using gcc 6.3.0, with -std=c11 only, this code gives a warning:

<source>: In function 'main':7 : <source>:7:3: warning: empty declaration   __attribute__((fallthrough));   ^~~~~~~~~~~~~

What is the correct way to use this without eliciting a warning?


Viewing all articles
Browse latest Browse all 22006

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>