Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

Drop strict-aliasing warnings from roslz4 file.#839

Merged
dirk-thomas merged 2 commits intoros:kinetic-develfrom
mikepurvis:patch-1
Jul 20, 2016
Merged

Drop strict-aliasing warnings from roslz4 file.#839
dirk-thomas merged 2 commits intoros:kinetic-develfrom
mikepurvis:patch-1

Conversation

@mikepurvis
Copy link
Copy Markdown
Member

Silences this build warning:

00:07:06.610 /tmp/binarydeb/ros-kinetic-roslz4-1.12.2/src/_roslz4module.c: In function ‘init_roslz4’:
00:07:06.610 /tmp/binarydeb/ros-kinetic-roslz4-1.12.2/src/_roslz4module.c:444:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
00:07:06.610    Py_INCREF(&LZ4Compressor_Type);
00:07:06.610    ^
00:07:06.610 /tmp/binarydeb/ros-kinetic-roslz4-1.12.2/src/_roslz4module.c:446:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
00:07:06.610    Py_INCREF(&LZ4Decompressor_Type);
00:07:06.610    ^

Source: http://build.ros.org/job/Kbin_uX64__roslz4__ubuntu_xenial_amd64__binary/4/console

@dirk-thomas
Copy link
Copy Markdown
Member

Are you sure that the warning is gone with this patch? I would think it needs either -Wno-strict-aliasing or -fno-strict-aliasing (http://cellperformance.beyond3d.com/articles/2006/06/understanding-strict-aliasing.html).

@mikepurvis
Copy link
Copy Markdown
Member Author

Oh, good catch. I was thrown off by the PR builder here not showing the warning.

@dirk-thomas
Copy link
Copy Markdown
Member

The devel job (and therefore the pr job) doesn't show the warning. I think the release job only shows it due to it optimization level.

The patch looks good to me (just suppressing the warning which has been there for a while. I am just not sure if the warning posses any problem. If yes, using -fno-strict-aliasing might be safer?

@dirk-thomas
Copy link
Copy Markdown
Member

I guess the Python API is designed like that on purpose (http://osdir.com/ml/python.cython.devel/2008-04/msg00080.html). Will merge once it's "green". Thanks.

@dirk-thomas dirk-thomas merged commit 04c9cb9 into ros:kinetic-devel Jul 20, 2016
@mikepurvis mikepurvis deleted the patch-1 branch July 20, 2016 17:19
rsinnet pushed a commit to MisoRobotics/ros_comm that referenced this pull request Jun 19, 2017
Drop strict-aliasing warnings from roslz4 file.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants