Skip to content

Turn off some warnings for QoS for gcc13 #42

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

Merged
merged 6 commits into from
May 20, 2025

Conversation

doug1234
Copy link
Contributor

Note: These warnings could be due to issues with OpenDDS but turn them off for now.

Copy link
Member

@mitza-oci mitza-oci left a comment

Choose a reason for hiding this comment

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

Do you have a link to the warning that this is preventing? I'll check if we can fix it in OpenDDS.

The new code is generating its own warning on compilers that don't have a -Wstringop-overflow, so this may need to be conditional on the specific compiler/version:
https://github.com/OpenDDS/OpenDDW/actions/runs/15005619676/job/42163404066?pr=42#step:24:61

@doug1234
Copy link
Contributor Author

doug1234 commented May 14, 2025

In static member function ‘static _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = short int; _Up = short int; bool _IsMove = false]’,
    inlined from ‘_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = short int*; _OI = short int*]’ at /opt/rh/gcc-toolset-13/root/usr/include/c++/13/bits/stl_algobase.h:506:30,
    inlined from ‘_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = short int*; _OI = short int*]’ at /opt/rh/gcc-toolset-13/root/usr/include/c++/13/bits/stl_algobase.h:533:42,
    inlined from ‘_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = short int*; _OI = short int*]’ at /opt/rh/gcc-toolset-13/root/usr/include/c++/13/bits/stl_algobase.h:540:31,
    inlined from ‘_OI std::copy(_II, _II, _OI) [with _II = short int*; _OI = short int*]’ at /opt/rh/gcc-toolset-13/root/usr/include/c++/13/bits/stl_algobase.h:633:7,
    inlined from ‘static void TAO::details::value_traits<T, dummy>::copy_range(value_type*, value_type*, iter) [with iter = short int*; T = short int; bool dummy = true]’ at /sandbox/gitlab-runner-ibst/builds/ibst/products/open-source/OpenDDW/spm-rhel9-gcc13/open-source/opendds/include/tao/Value_Traits_T.h:52:14,
    inlined from ‘static void TAO::details::value_traits<T, dummy>::copy_swap_range(value_type*, value_type*, iter) [with iter = short int*; T = short int; bool dummy = true]’ at /sandbox/gitlab-runner-ibst/builds/ibst/products/open-source/OpenDDW/spm-rhel9-gcc13/open-source/opendds/include/tao/Value_Traits_T.h:60:15,
    inlined from ‘void TAO::details::generic_sequence<T, ALLOCATION_TRAITS, ELEMENT_TRAITS>::length(CORBA::ULong) [with T = short int; ALLOCATION_TRAITS = TAO::details::unbounded_value_allocation_traits<short int, true>; ELEMENT_TRAITS = TAO::details::value_traits<short int, true>]’ at /sandbox/gitlab-runner-ibst/builds/ibst/products/open-source/OpenDDW/spm-rhel9-gcc13/open-source/opendds/include/tao/Generic_Sequence_T.h:239:36,
    inlined from ‘void TAO::details::generic_sequence<T, ALLOCATION_TRAITS, ELEMENT_TRAITS>::length(CORBA::ULong) [with T = short int; ALLOCATION_TRAITS = TAO::details::unbounded_value_allocation_traits<short int, true>; ELEMENT_TRAITS = TAO::details::value_traits<short int, true>]’ at /sandbox/gitlab-runner-ibst/builds/ibst/products/open-source/OpenDDW/spm-rhel9-gcc13/open-source/opendds/include/tao/Generic_Sequence_T.h:198:8,
    inlined from ‘void TAO::unbounded_value_sequence<T, Tag>::length(CORBA::ULong) [with T = short int; Tag = int]’ at /sandbox/gitlab-runner-ibst/builds/ibst/products/open-source/OpenDDW/spm-rhel9-gcc13/open-source/opendds/include/tao/Unbounded_Value_Sequence_T.h:60:17,
    inlined from ‘void {anonymous}::init(DDS::TopicQos&)’ at /sandbox/gitlab-runner-ibst/builds/ibst/products/open-source/OpenDDW/OpenDDW/src/qos_dictionary.cpp:54:40,
    inlined from ‘DDS::TopicQos QosDictionary::Topic::bestEffort()’ at /sandbox/gitlab-runner-ibst/builds/ibst/products/open-source/OpenDDW/OpenDDW/src/qos_dictionary.cpp:228:9:
/opt/rh/gcc-toolset-13/root/usr/include/c++/13/bits/stl_algobase.h:437:30: error: ‘void* __builtin_memmove(void*, const void*, long unsigned int)’ forming offset 2 is out of the bounds [0, 2] [-Werror=array-bounds=]
  437 |             __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
      |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@iguessthislldo
Copy link
Member

If we can't fix in OpenDDS, we can check for the warning so it doesn't cause warnings in other compilers.

@iguessthislldo
Copy link
Member

What was wrong with 65b076f? It looks correct to me and I didn't see any warnings on it.

@doug1234
Copy link
Contributor Author

It didn't seem to work with gcc13 so it didn't fix the original problem sadly. The latest actually works.

@mitza-oci
Copy link
Member

It didn't seem to work with gcc13 so it didn't fix the original problem sadly. The latest actually works.

Is that issue with GCC 13 visible in the CI builds on ubuntu-24.04 (GCC 13 is the default version on Ubuntu 24.04)? If not, is there a configuration change we could make in the CI?

@doug1234
Copy link
Contributor Author

I had the issue when I built locally with gcc13. It looks like you are using gcc11 unless I am looking at the wrong thing. The CXX compiler identification is GNU 11.4.0

@mitza-oci
Copy link
Member

I had the issue when I built locally with gcc13. It looks like you are using gcc11 unless I am looking at the wrong thing. The CXX compiler identification is GNU 11.4.0

22.04 is GCC 11; 24.04 is GCC 13

https://github.com/OpenDDS/OpenDDW/actions/runs/15076340483/job/42384505992#step:24:27

@doug1234
Copy link
Contributor Author

Hum... I am confused then. It seems that you never got this warning with gcc13 in CI?

@doug1234 doug1234 requested a review from mitza-oci May 19, 2025 14:32
@iguessthislldo
Copy link
Member

It didn't seem to work with gcc13 so it didn't fix the original problem sadly. The latest actually works.

I looked at the stackoverflow link again and discovered __has_warning is Clang only. My bad for linking something that didn't work in this situation.

@doug1234
Copy link
Contributor Author

@iguessthislldo that makes sense but how come we are not seeing the warnings on the gcc13 build through CI. I see them when I build with gcc13 so its odd.

@mitza-oci
Copy link
Member

I didn't see the warning in a local build with GCC 14 (I don't happen to have 13 installed on that particular VM anymore).
I may also have a different version of TAO but I think this code is essentially the same.

As far as I can tell the warning from the compiler isn't meaningful and can be ignored. That's just a theory, but if we ran an OpenDDW-using program through valgrind or asan it might help to validate.

@mitza-oci mitza-oci merged commit b71ef0d into OpenDDS:master May 20, 2025
12 checks passed
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.

3 participants