Bug 200681 - gcc warnings with dlopen example
Summary: gcc warnings with dlopen example
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: man-pages
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Marcela Mašláňová
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-07-30 19:22 UTC by Patrice Dumas
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-08-15 08:33:14 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Patrice Dumas 2006-07-30 19:22:30 UTC
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 16:31:22 UTC
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.