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

Fix compilation with newer compilers: GCC-14 and CLANG-16 #759

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gladk
Copy link

@gladk gladk commented Oct 15, 2024

These changes are letting the project be compiled with the current Debian Testing, where Clang-16 and GCC-14.2 are default versions.

third_party/fmt/include/fmt/ranges.h:215:59: error: self-comparison always evaluates to true [-Werror=tautological-compare]
  215 |                                integer_sequence<bool, (Is == Is)...>);

 Is == Is is always true. Upstream uses Is >=0 which is more meaningful to check non-negative
 index values.

 https://github.com/fmtlib/fmt/blob/cc2ba8f9ede4e5ae3262f43f3e4d07a22a9acdfc/include/fmt/ranges.h#L162
bustub/src/type/timestamp_type.cpp: In member function ‘virtual std::string bustub::TimestampType::ToString(const bustub::Value&) const’:
bustub/src/type/timestamp_type.cpp:130:29: error: ‘%02d’ directive output may be truncated writing between 2 and 10 bytes into a region of size 5 [-Werror=format-truncation=]
  130 |   snprintf(zone, zone_len, "%02d", tz);  // NOLINT
        |                             ^~~~
bustub/src/type/timestamp_type.cpp:130:28: note: directive argument in the range [0, 2147483647]
          130 |   snprintf(zone, zone_len, "%02d", tz);  // NOLINT
                |                            ^~~~~~
bustub/src/type/timestamp_type.cpp:130:11: note: ‘snprintf’ output between 3 and 11 bytes into a destination of size 5
                  130 |   snprintf(zone, zone_len, "%02d", tz);  // NOLINT
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.

1 participant