LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-15-2005, 05:37 AM   #1
lucs
Member
 
Registered: Feb 2005
Posts: 39

Rep: Reputation: 15
Warning and errors with make


Hello! I've got a problem because I don't understand what this message means:

In file included from /usr/src/linux/include/linux/spinlock.h:6,
from /usr/src/linux/include/linux/module.h:12,
from driver/modules/hostap_cs.c:8:
/usr/src/linux/include/asm/system.h: In function `__set_64bit_var':
/usr/src/linux/include/asm/system.h:190: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/src/linux/include/asm/system.h:190: warning: dereferencing type-punned pointer will break strict-aliasing rules

Could anyone help me?thank you very much! lucs
 
Old 03-15-2005, 07:09 AM   #2
djbanaan
Member
 
Registered: Aug 2003
Location: Haarlem, The Netherlands
Distribution: Slackware, FreeBSD
Posts: 178

Rep: Reputation: 30
Albeit annoying, I don't think these warnings are very serious. Does the build fail? What exactly is it you're compiling?
 
Old 03-15-2005, 07:11 AM   #3
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
looks like he's compiling a kernel; those warnings are just warnings. Errors are what you need to worry about
 
Old 03-16-2005, 05:32 AM   #4
lucs
Member
 
Registered: Feb 2005
Posts: 39

Original Poster
Rep: Reputation: 15
In fact...these aren't errors and the system compiles the file but I would like to know: why these warnings appear? And how can I read these lines?For example....what is the file that cause warning?
 
Old 03-16-2005, 05:37 AM   #5
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
Re: Warning and errors with make

Quote:
Originally posted by lucs
Hello! I've got a problem because I don't understand what this message means:

In file included from /usr/src/linux/include/linux/spinlock.h:6,
from /usr/src/linux/include/linux/module.h:12,
from driver/modules/hostap_cs.c:8:
/usr/src/linux/include/asm/system.h: In function `__set_64bit_var':
/usr/src/linux/include/asm/system.h:190: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/src/linux/include/asm/system.h:190: warning: dereferencing type-punned pointer will break strict-aliasing rules

Could anyone help me?thank you very much! lucs
the red is the file that gcc is complaining about

the blue is the line number where the error/warning occurs
 
Old 03-16-2005, 05:52 AM   #6
WilliamS
Member
 
Registered: Nov 2003
Location: 46N 76W
Distribution: Slackware 14.1
Posts: 380

Rep: Reputation: 31
I've noticed this and other oddities since I started using 10.1.
 
Old 03-16-2005, 06:24 AM   #7
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
from the gcc manual:

-fstrict-aliasing
Allows the compiler to assume the strictest aliasing rules applicable to the language being compiled. For C (and C++), this activates optimizations based on the type of expressions. In particular, an object of one type is assumed never to reside at the same address as an object of a different type, unless the types are almost the same. For example, an unsigned int can alias an int, but not a void* or a double. A character type may alias any other type.

Pay special attention to code like this:

union a_union {
int i;
double d;
};

int f() {
a_union t;
t.d = 3.0;
return t.i;
}


The practice of reading from a different union member than the one most recently written to (called “type-punning”) is common. Even with -fstrict-aliasing, type-punning is allowed, provided the memory is accessed through the union type. So, the code above will work as expected. However, this code might not:

int f() {
a_union t;
int* ip;
t.d = 3.0;
ip = &t.i;
return *ip;
}


Every language that wishes to perform language-specific alias analysis should define a function that computes, given an tree node, an alias set for the node. Nodes in different alias sets are not allowed to alias. For an example, see the C front-end function c_get_alias_set.

Enabled at levels -O2, -O3, -Os.

keep in mind it also depends on the version of gcc being used. a recent version is going to spit out more warnings than an older version due to depecated features and such.

Last edited by __J; 03-16-2005 at 06:28 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Warning on running "make check", 2nd time satimis Linux From Scratch 8 07-11-2005 03:46 AM
Make errors lazwaz Linux - Software 1 05-21-2005 04:37 AM
Chap 5 Binutils make LDFLAGS & make install errors shotokan Linux From Scratch 5 04-10-2005 03:01 AM
Warning / error during make install Jeebizz Slackware 4 10-18-2004 10:54 PM
'make' errors... drenal Linux - Newbie 3 04-21-2004 07:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration