Bug 200681

Summary: gcc warnings with dlopen example
Product: [Fedora] Fedora Reporter: Patrice Dumas <pertusus>
Component: man-pagesAssignee: Marcela Mašláňová <mmaslano>
Status: CLOSED RAWHIDE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideKeywords: Reopened
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-15 08:33:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.