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

CI updates #1947

Merged
merged 7 commits into from Mar 27, 2024
Merged

CI updates #1947

merged 7 commits into from Mar 27, 2024

Conversation

eboasson
Copy link
Contributor

This bumps the CI platforms. That in turn causes some trouble with (in particular) gcc and macOS.

- Windows 2022
- GCC 13
- macOS 13

Signed-off-by: Erik Boasson <eb@ilities.com>
Leaving out a lot of details in the actual code, this:

     serdata_x_from_ser (... const struct ddsi_rdata *fragchain ...)
     {
  (1)  assert (fragchain->min == 0);
  (2)  while (fragchain)
         fragchain = fragchain->nextfrag;

triggered a warning from the gcc 13.1 static analyzer that fragchain was
tested for a null pointer at (2) after having dereferenced it already
at (1).  Clearly this is because the function is not annotated as
required a non-null fragchain on input.

This commit adds these non-null annotation (and some "warn unused
result" ones) on the ddsi_serdata_... functions.  The cases where this
resulted in new warnings have also been updated.

Signed-off-by: Erik Boasson <eb@ilities.com>
* We don't care about malloc failures in "dynsub", asserting the result is not a null
  pointer pacifies the analyzer

* The roundtrip example had an "interesting" way of updating the statistics object that
  caused a false-positive leak warning from the analyzer. The warning disappears by
  simply eliminating the interesting bit

* Some false positives on leaking file descriptors in TCP support code

* Ouput buffer size in snprintf that was flagged as potentially too small (which it is
  true if the integer being printed can have any valid value, but it can't)

* Some warnings related to possible malloc failures in ucunit

Signed-off-by: Erik Boasson <eb@ilities.com>
This despite the variable getting reassigned by a potentially null pointer. Using a
separete variable solves the problem and is arguably better style.

Signed-off-by: Erik Boasson <eb@ilities.com>
There are false positive warnings for

- stringop-overflow
- array-bounds

that don't seem to be suppressible using Pragmas.  From what I can tell, they occur on gcc
13.1 but not gcc 13.2.  Sadly, gcc 13.1 is the latest version of gcc that is available on
Ubuntu 22.04, so this would imply being stuck on a really old gcc version in the CI where
we use -Werror.

This commit prevents these two warnings from being treated as errors, but only if it is
gcc 13.0 or gcc 13.1.  That way the risk of not treating them as errors should be
minimized.

Signed-off-by: Erik Boasson <eb@ilities.com>
Copy link
Contributor

@dpotman dpotman left a comment

Choose a reason for hiding this comment

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

Looks good!

@eboasson eboasson merged commit dfdbaf1 into eclipse-cyclonedds:master Mar 27, 2024
19 of 21 checks passed
clalancette added a commit to clalancette/cyclonedds that referenced this pull request Apr 2, 2024
This is a partial backport of eclipse-cyclonedds#1947

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
eboasson pushed a commit that referenced this pull request Apr 2, 2024
This is a partial backport of #1947

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
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.

None yet

2 participants