Skip to content

Commit

Permalink
build: Enable C99 support in meson.build
Browse files Browse the repository at this point in the history
We use C99 features (cd-spectrum.c:760), so need to explicitly enable them
in meson.build, as some compilers will not enable them automatically,
and will instead error when they encounter usage of C99.

Signed-off-by: Philip Withnall <[email protected]>
  • Loading branch information
pwithnall authored and hughsie committed Aug 12, 2017
1 parent 419fdf4 commit b5436b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
project('colord', 'c',
version : '1.4.1',
license : 'LGPL-2.1+',
meson_version : '>=0.37.0'
meson_version : '>=0.37.0',
default_options : ['c_std=c99']
)

colord_version = meson.project_version()
Expand Down

5 comments on commit b5436b4

@jbicha
Copy link

@jbicha jbicha commented on b5436b4 Sep 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pwithnall I think we should revert this commit. By enforcing C99, you're preventing meson from using a newer C standard. There's an interesting related bug in pango: https://gitlab.gnome.org/GNOME/pango/merge_requests/19

@pwithnall
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would Meson use a newer C standard without being asked to? This commit was made because compilers were not enabling the C99 features used in colord by default, and compilation was failing (see the commit message). If colord wants to use newer C features, the c_std can be updated to something newer. Otherwise, this is doing its job in making sure that colord can use C99 features and nothing newer.

I don’t see any details about what the actual problem is on that Pango report, or why dropping c_std=c99 is the most appropriate fix.

@jbicha
Copy link

@jbicha jbicha commented on b5436b4 Sep 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gcc nowadays defaults to C11 but specifying C99 will override that. Do you have a particular reason why you don't want to use C11 now?

@pwithnall
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s a project policy thing, which is up to @hughsie not me. I only submitted the C99 patch in the first place because the project was already using C99 features.

@jbicha
Copy link

@jbicha jbicha commented on b5436b4 Sep 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I filed #81

Please sign in to comment.