Skip to content

Clang Compilation Error on NetBSD Due to Incorrect Fallthrough Annotation #130099

@furkanonder

Description

@furkanonder

Bug report

Bug description:

Configuration:
configure-output.txt

./configure CC=clang LD=clang --disable-ipv6

Build:

make

Output:

clang -pthread -fno-strict-overflow -I/usr/pkg/include -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall  -O2  -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include    -fPIC -c ./Modules/_ctypes/callproc.c -o Modules/_ctypes/callproc.o
--- Modules/socketmodule.o ---
./Modules/socketmodule.c:2262:13: error: fallthrough annotation does not directly precede switch label
 2262 |             _Py_FALLTHROUGH;
      |             ^
./Include/pyport.h:635:27: note: expanded from macro '_Py_FALLTHROUGH'
  635 | #  define _Py_FALLTHROUGH __attribute__((fallthrough))
      |                           ^
--- Modules/_ctypes/stgdict.o ---
clang -pthread -fno-strict-overflow -I/usr/pkg/include -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall  -O2  -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include    -fPIC -c ./Modules/_ctypes/stgdict.c -o Modules/_ctypes/stgdict.o
--- Modules/socketmodule.o ---
1 error generated.
--- Modules/_ctypes/cfield.o ---
clang -pthread -fno-strict-overflow -I/usr/pkg/include -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall  -O2  -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include    -fPIC -c ./Modules/_ctypes/cfield.c -o Modules/_ctypes/cfield.o
--- Modules/socketmodule.o ---
*** [Modules/socketmodule.o] Error code 1

make: stopped in /home/blue/cpython
1 error

make: stopped in /home/blue/cpython

CPython versions tested on:

CPython main branch

Operating systems tested on:

Other

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-netbsdbuildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions