Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latest Master compiling error: "unknown type name ‘bool’" #16157

Closed
s7habo opened this issue Jan 20, 2024 · 13 comments
Closed

latest Master compiling error: "unknown type name ‘bool’" #16157

s7habo opened this issue Jan 20, 2024 · 13 comments
Assignees
Labels
bug: pending someone needs to start working on that
Milestone

Comments

@s7habo
Copy link

s7habo commented Jan 20, 2024

Describe the bug

When compiling the latest version of Master just now, I get the following error message:

/home/s7habo/darktable/src/common/variables.c:311:8: error: unknown type name ‘bool’
  311 | static bool _is_number(char *str)
      |        ^~~~
compilation terminated due to -Wfatal-errors.
gmake[2]: *** [bin/CMakeFiles/lib_darktable.dir/build.make:1146: bin/CMakeFiles/lib_darktable.dir/common/variables.c.o] Fehler 1
gmake[2]: *** Auf noch nicht beendete Prozesse wird gewartet …
gmake[1]: *** [CMakeFiles/Makefile2:2431: bin/CMakeFiles/lib_darktable.dir/all] Fehler 2
gmake: *** [Makefile:156: all] Fehler 2

Steps to reproduce

cd darktable
sudo git clean -d -f -x
rm -rf ~/.cache/darktable/cached_kernels*
git pull --rebase
git submodule update

sudo su

export CC=gcc-12
export CXX=g++-12
./build.sh --prefix /opt/darktable-test --build-type Release --install --sudo

Expected behavior

No response

Logfile | Screenshot | Screencast

No response

Commit

No response

Where did you obtain darktable from?

self compiled

darktable version

lastest Master

What OS are you using?

Linux

What is the version of your OS?

Ubuntu Studio 22.04

Describe your system?

Operating System: Ubuntu Studio 22.04
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Kernel Version: 5.19.0-1028-lowlatency (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-7700K CPU @ 4.20GHz
Memory: 31.3 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1070/PCIe/SSE2
G Driver 535.129.03

Are you using OpenCL GPU in darktable?

Yes

If yes, what is the GPU card and driver?

NVIDIA GeForce GTX 1070/PCIe/SSE2 G Driver 535.129.03

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

No response

@TurboGit
Copy link
Member

Should be fixed now, thanks for reporting.

@TurboGit TurboGit added this to the 4.8 milestone Jan 20, 2024
@TurboGit TurboGit added the bug: pending someone needs to start working on that label Jan 20, 2024
@TurboGit TurboGit self-assigned this Jan 20, 2024
@s7habo
Copy link
Author

s7habo commented Jan 20, 2024

I'm getting the next one now:

/home/s7habo/darktable/src/common/variables.c: In function ‘_is_number’:
/home/s7habo/darktable/src/common/variables.c:314:37: error: ‘false’ undeclared (first use in this function)
  314 |   if(!g_ascii_isdigit(*str)) return false;  // don't take empty strings
      |                                     ^~~~~
compilation terminated due to -Wfatal-errors.
gmake[2]: *** [bin/CMakeFiles/lib_darktable.dir/build.make:1146: bin/CMakeFiles/lib_darktable.dir/common/variables.c.o] Fehler 1
gmake[2]: *** Auf noch nicht beendete Prozesse wird gewartet …
gmake[1]: *** [CMakeFiles/Makefile2:2431: bin/CMakeFiles/lib_darktable.dir/all] Fehler 2
gmake: *** [Makefile:156: all] Fehler 2

@TurboGit
Copy link
Member

I'm getting the next one now:

Hopefully fixed now...

@s7habo
Copy link
Author

s7habo commented Jan 20, 2024

Yes, everything went well. Thanks for the quick fix!

@kmilos
Copy link
Contributor

kmilos commented Jan 20, 2024

Curious how this got past the CI?

@TurboGit
Copy link
Member

And it was also compiling fine for me.

@kmilos
Copy link
Contributor

kmilos commented Jan 21, 2024

I've seen it as well on my Windows machine, while the Windows CI was passing, very strange...

@victoryforce
Copy link
Collaborator

There's nothing strange. C90 does not support the boolean data type. C99 does. If you look at the build logs on all CI platforms, you will see -std=gnu99 on the command line of the compiler call. Apparently, for some reason, @s7habo's gcc (which was gcc12, whereas we at CI run newer compilers) started in C90 mode. This seems to be the default gcc12 setting in Ubuntu...

@kmilos
Copy link
Contributor

kmilos commented Jan 21, 2024

Mine is GCC 13.2 on Windows. Same as CI. I don't think I do anything differently, no special compiler flags...

@parafin
Copy link
Member

parafin commented Jan 21, 2024

But C99 standard is enabled in dt's cmake:

set(CMAKE_C_STANDARD 99)

So it's not about C standard version IMHO, but maybe about support of said feature (bool, true and false) by various compiler versions.

@parafin
Copy link
Member

parafin commented Jan 21, 2024

Or, more likely, it's just about including <stdbool.h>. On some systems it may be included by some other includes, on others - not.

@kmilos
Copy link
Contributor

kmilos commented Jan 21, 2024

Still doesn't explain why my local Windows MSYS2 build failed while the (presumably identically set up) CI didn't.

@parafin
Copy link
Member

parafin commented Jan 21, 2024

Well, there I can’t help, obviously they are different. E.g. enabled features and dependencies (and their versions) can affect includes, not just base build environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: pending someone needs to start working on that
Projects
None yet
Development

No branches or pull requests

5 participants