Skip to content

fix bool reserved word error in gcc 15 #4

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

markyang92
Copy link

  • Fix build error with gcc-15.0.1 http://errors.yoctoproject.org/Errors/Details/850147/ srcdir/lib/util/include/bool.h:13:5: error: cannot use keyword 'false' as enumeration constant
    13 | false = 0,
    | ^~~~~
    srcdir/lib/util/include/bool.h:13:5: note: 'false' is a keyword with '-std=c23' onwards
    srcdir/lib/util/include/bool.h:15:3: error: expected ';', identifier or '(' before 'bool'
    15 | } bool;
    | ^~~~
    srcdir/lib/util/include/bool.h:15:3: warning: useless type name in empty declaration
    In file included from sleep.c:2:
    srcdir/lib/util/include/bool.h:13:5: error: cannot use keyword 'false' as enumeration constant
    13 | false = 0,
    | ^~~~~
    srcdir/lib/util/include/bool.h:13:5: note: 'false' is a keyword with '-std=c23' onwards
    srcdir/lib/util/include/bool.h:15:3: error: expected ';', identifier or '(' before 'bool'
    15 | } bool;
    | ^~~~

    gcc-15 switched to -std=c23 by default. https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212

* Fix build error with gcc-15.0.1
  http://errors.yoctoproject.org/Errors/Details/850147/
    srcdir/lib/util/include/bool.h:13:5: error: cannot use keyword 'false' as enumeration constant
    13 |     false = 0,
        |     ^~~~~
    srcdir/lib/util/include/bool.h:13:5: note: 'false' is a keyword with '-std=c23' onwards
    srcdir/lib/util/include/bool.h:15:3: error: expected ';', identifier or '(' before 'bool'
    15 | } bool;
        |   ^~~~
    srcdir/lib/util/include/bool.h:15:3: warning: useless type name in empty declaration
    In file included from sleep.c:2:
    srcdir/lib/util/include/bool.h:13:5: error: cannot use keyword 'false' as enumeration constant
    13 |     false = 0,
        |     ^~~~~
    srcdir/lib/util/include/bool.h:13:5: note: 'false' is a keyword with '-std=c23' onwards
    srcdir/lib/util/include/bool.h:15:3: error: expected ';', identifier or '(' before 'bool'
    15 | } bool;
        |   ^~~~

  gcc-15 switched to -std=c23 by default.
  https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212

Signed-off-by: mark.yang <[email protected]>
Copy link

@kraj kraj left a comment

Choose a reason for hiding this comment

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

lgtm

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