Skip to content

type-limits check prevents compiling 4.2 version by GCC 11 #1322

Closed

Description

@grabusr

Godot version

4.2

godot-cpp version

4.2-stable

System information

Ubuntu 22.04.3 LTS, gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

Issue description

Compilation error is raised:

godot-cpp/src/godot.cpp:274:60: error: comparison of unsigned expression in ‘>= 0’ is always true [-Werror=type-limits]
  274 |                 compatible = internal::godot_version.patch >= GODOT_VERSION_PATCH;

Reason of that is we compare uint32_t patch variable with GODOT_VERSION_PATCH, which value is 0.

Steps to reproduce

Just try to compile tag godot-4.2-stable with gcc-11.4 in Release config

Minimal reproduction project

Just try to compile tag godot-4.2-stable with gcc-11.4 in Release config

Activity

  1. changed the title [-]`type-limits` check prevent compiling on GCC 11[/-] [+]`type-limits` check prevent compiling 4.2 version on GCC 11[/+] on Nov 30, 2023
  2. changed the title [-]`type-limits` check prevent compiling 4.2 version on GCC 11[/-] [+]`type-limits` check prevents compiling 4.2 version on GCC 11[/+] on Nov 30, 2023
  3. changed the title [-]`type-limits` check prevents compiling 4.2 version on GCC 11[/-] [+]`type-limits` check prevents compiling 4.2 version by GCC 11[/+] on Nov 30, 2023
  4. dsnopek commented on Nov 30, 2023

    @dsnopek
    Collaborator

    Oof, that is silly! I wish GCC would just automatically turn that into true, rather than making it an error.

    I just posted PR #1323 which should fix it, although, I'm not personally getting this error locally even though I have GCC 11.4 and I'm on the same distro (Ubuntu 22.04) as you.

    So, please test and let me know if it fixes the issue for you!

  5. added
    bug
    on Nov 30, 2023
  6. added this to the 4.x milestone on Nov 30, 2023
  7. added
    topic:buildsystem
    on Nov 30, 2023
  8. akien-mga commented on Nov 30, 2023

    @akien-mga
    Member

    It's not an error, just a warning. But the OP's build has warnings treated as errors (-Werror).

    I don't see where we'd enable this by default in the SCons setup, but it seems CMake forces it on, so that might be the problem.

    -Werror shouldn't be enabled by default, because we can't control what warnings new compilers might find in the future.

  9. modified the milestones: 4.x, 4.3 on Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtopic:buildsystem

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions