This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 200681 - gcc warnings with dlopen example
gcc warnings with dlopen example
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: man-pages (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Marcela Mašláňová
Ben Levenson
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-30 15:22 EDT by Patrice Dumas
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-08-15 04:33:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Patrice Dumas 2006-07-30 15:22:30 EDT
Description of problem:
When compiled with -Wall the example in dlopen.3 there are 
warnings:

[dumas@localhost examples]$ gcc -Wall -g -O2 dlsym.c -o dlsym -ldl
dlsym.c: In function 'main':
dlsym.c:12: warning: implicit declaration of function 'exit'
dlsym.c:12: warning: incompatible implicit declaration of built-in function 'exit'
dlsym.c:16: warning: dereferencing type-punned pointer will break
strict-aliasing rules
dlsym.c:19: warning: incompatible implicit declaration of built-in function 'exit'
dlsym.c:24: warning: control reaches end of non-void function

The warning: control reaches end of non-void function is not
problematic, the exit error is fixed with 
#include <stdlib.h>

but the
dlsym.c:16: warning: dereferencing type-punned pointer will break
strict-aliasing rules
seems really problematic to me.

Version-Release number of selected component (if applicable):

man-pages-2.36-2

How reproducible:

cut and paste the example in man dlopen
compile with 
gcc -Wall -g -O2

Steps to Reproduce:
1.
2.
3.
  
Actual results:

strict-aliasing is broken

Expected results:

no break of strict-aliasing

Additional info:
Comment 1 Patrice Dumas 2006-08-11 12:31:22 EDT
This update doesn't fix the most annoying warning, namely

dlsym.c:16: warning: dereferencing type-punned pointer will break
strict-aliasing rules

I reopen the bug.

Note You need to log in before you can comment on or make changes to this bug.