Skip to content

Conversation

@kxxt
Copy link

@kxxt kxxt commented Nov 15, 2025

Previously the cmake file only sets -std=gnu99 when it is on x86(-64), which causes compilation failure on other architectures when gcc is used.

GCC currently defaults to -std=gnu23, which would fail the build with:

blosc/shuffle.c:26:15: error: ‘bool’ cannot be defined via ‘typedef’

This patch fixes it by setting -std=gnu99 for gcc on all architectures.

Previously the cmake file only sets `-std=gnu99` when it is on x86(-64),
which causes compilation failure on other architectures when gcc is
used.

GCC currently defaults to `-std=gnu23`, which would fail the build with:

    blosc/shuffle.c:26:15: error: ‘bool’ cannot be defined via ‘typedef’

This patch fixes it by setting `-std=gnu99` for gcc on all
architectures.
kxxt added a commit to kxxt/archriscv-packages that referenced this pull request Nov 15, 2025
Set `-std=gnu99` for all architectures to fix build: Blosc/c-blosc#399
kxxt added a commit to kxxt/archriscv-packages that referenced this pull request Nov 15, 2025
Set `-std=gnu99` for all architectures to fix build: Blosc/c-blosc#399
@kalvdans
Copy link
Contributor

Why first check if the compiler is gcc? If our code is written in the gnu99 dialect, it should be passed to any compiler. Clang also supports compiling gnu99 code.

@kxxt
Copy link
Author

kxxt commented Nov 15, 2025

Why first check if the compiler is gcc? If our code is written in the gnu99 dialect, it should be passed to any compiler.

The original code sets it to gnu99 only for the GCC compiler. So I kepted that.

Clang also supports compiling gnu99 code.

That's nice! But I suppose msvc don't support it?

@kalvdans
Copy link
Contributor

That's nice! But I suppose msvc don't support it?

I doubt. But how can it then compile the code?

felixonmars pushed a commit to felixonmars/archriscv-packages that referenced this pull request Nov 17, 2025
Set `-std=gnu99` for all architectures to fix build: Blosc/c-blosc#399
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants