Skip to content

Resolve compiler warnings emited by clang#35

Merged
alt-graph merged 2 commits intomainfrom
bugfix/resolve-clang-compiler-warnings
Jun 11, 2025
Merged

Resolve compiler warnings emited by clang#35
alt-graph merged 2 commits intomainfrom
bugfix/resolve-clang-compiler-warnings

Conversation

@soerengrunewald
Copy link
Copy Markdown
Contributor

Why

There are some really annoying warnings which are spammed if compiling with clang.
Since we use gul includes all over, every include will emit these warnings.

[Why]
If compiled with clang and -Wconversion enabled, the compiler complains:
> gul17/span.h:211:42: warning: implicit conversion changes signedness: 'long' to 'std::size_t' (aka 'unsigned long') [-Wsign-conversion]
>   211 |         : storage_(first_elem, last_elem - first_elem)
>       |           ~~~~~~~~             ~~~~~~~~~~^~~~~~~~~~~~

Signed-off-by: Soeren Grunewald <soeren.grunewald@desy.de>
[Why]
If compiled with clang, the compiler complains:
> include/gul14/date.h:912:41: warning: identifier '_d' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]
>   912 | constexpr gul14::date::day  operator "" _d(unsigned long long d) noexcept;
>   |                             ~~~~~~~~~~~~^~
>       |                             operator""_d
> include/gul14/date.h:913:41: warning: identifier '_y' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]
>   913 | constexpr gul14::date::year operator "" _y(unsigned long long y) noexcept;
>   |                             ~~~~~~~~~~~~^~
>   |                             operator""_y
> include/gul14/date.h:1813:13: warning: identifier '_d' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]
>  1813 | operator "" _d(unsigned long long d) noexcept
>   | ~~~~~~~~~~~~^~
>   | operator""_d
> include/gul14/date.h:1820:13: warning: identifier '_y' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]
>  1820 | operator "" _y(unsigned long long y) noexcept
>   | ~~~~~~~~~~~~^~
>       | operator""_y

Signed-off-by: Soeren Grunewald <soeren.grunewald@desy.de>
Copy link
Copy Markdown
Member

@alt-graph alt-graph left a comment

Choose a reason for hiding this comment

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

Straightforward changes, makes sense. Thanks, @soerengrunewald!

@alt-graph alt-graph merged commit 820deda into main Jun 11, 2025
3 checks passed
@alt-graph alt-graph deleted the bugfix/resolve-clang-compiler-warnings branch June 11, 2025 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants