[bug-notifications] [libassuan 0004628]: assuan-uds.c:211:3: warning: dereferencing type-punned pointer will break strict-aliasing rules

Mantis Bug Tracker noreply at opencsw.org
Wed Dec 8 16:47:19 CET 2010


The following issue has been CLOSED 
====================================================================== 
https://www.opencsw.org/mantis/view.php?id=4628 
====================================================================== 
Reported By:                c1pher
Assigned To:                dam
====================================================================== 
Project:                    libassuan
Issue ID:                   4628
Category:                   other
Reproducibility:            always
Severity:                   trivial
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             2010-12-07 19:29 CET
Last Modified:              2010-12-08 16:47 CET
====================================================================== 
Summary:                    assuan-uds.c:211:3: warning: dereferencing
type-punned pointer will break strict-aliasing rules
Description: 
Small Quality Assurance issue. 

To quote the Gentoo bug report:
The most common warning you will see is probably "dereferencing type-
punned pointer will break strict-aliasing rules".  The place where it
warns is in general not wrong -- what gcc tries to tell you is that you
will break the aliasing rules when you dereference the pointer later
(unless you cast it back to its original type first).  This warning
should be interpreted as saying that your interfaces are badly designed,
and the correct way to avoid the warning is to redesign them in a way
where you do not need to cast between conflicting types.  (Even if you
often can make this warning go away by changing void** to void*...) >>

Please read the actual standard too.  The rules about pointer type
conversions are at 6.3.2.3.  The appropriate paragraphs are paragraphs
1 and 7.

http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1124.pdf.

Our bug report is located at:
http://bugs.gentoo.org/show_bug.cgi?id=347807
====================================================================== 

---------------------------------------------------------------------- 
 (0008543) c1pher (reporter) - 2010-12-08 16:45
 https://www.opencsw.org/mantis/view.php?id=4628#c8543 
---------------------------------------------------------------------- 
My apologies. I submitted it with gnupg. Feel free to close this. Sorry for
the confusion.



More information about the bug-notifications mailing list