Thank you very much for reporting this issue.
GCC and Clang behave differently in this case.
Adding a pair of braces makes both compilers happy.

/**************************************************

$ gcc main.c -o main
$ echo $?
0

$ clang main.c -o main
main.c:5:13: error: expected expression
            int a = 30;
            ^
1 error generated.

$ echo $?
1

  **************************************************/

int main(int argc, char **argv) {
    switch (argc) {
        case 1:
            int a = 30;
            return 0;
        default:
            return 0;
    }
    return 0;
}

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2129689

Title:
  Ubuntu 24.04, Noble, linux-bluefield-6.8: Fix x86_64 compilation error
  in VFIO_DEVICE_P2P_DMA_BUF handler

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-bluefield/+bug/2129689/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to