* Re: udev 085 warnings
2006-04-05 9:10 udev 085 warnings Jan Engelhardt
@ 2006-04-05 19:03 ` Kay Sievers
2006-04-06 0:30 ` Michael Buesch
2006-04-06 2:09 ` Kay Sievers
2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2006-04-05 19:03 UTC (permalink / raw)
To: linux-hotplug
On Wed, Apr 05, 2006 at 11:10:40AM +0200, Jan Engelhardt wrote:
> I am currently compiling udev-085-14.src.rpm from the opensuse OSS-factory
> tree on a 64-bit arch and get a lot of these warnings:
>
> fat.c:325: warning: cast increases required alignment of target type
> 325:
> next = le32_to_cpu(*((uint32_t *) buf) & 0x0fffffff);
>
> Will there be a proper fix or is this just another of these nice gcc
> warnings that are superfluous?
GCC is correct warning about that, cause the Makefile asked for that
kind of warning. The buffer access is always aligned but the compiler
can't know that. To get rid of it, you would need to memcpy() the integer
in a variable or access it byte by byte and shift it to an integer
value. Removing -Wcast-align should be the easiest. :)
Kay
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: udev 085 warnings
2006-04-05 9:10 udev 085 warnings Jan Engelhardt
2006-04-05 19:03 ` Kay Sievers
@ 2006-04-06 0:30 ` Michael Buesch
2006-04-06 2:09 ` Kay Sievers
2 siblings, 0 replies; 4+ messages in thread
From: Michael Buesch @ 2006-04-06 0:30 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 1237 bytes --]
On Wednesday 05 April 2006 21:03, Kay Sievers wrote:
> On Wed, Apr 05, 2006 at 11:10:40AM +0200, Jan Engelhardt wrote:
> > I am currently compiling udev-085-14.src.rpm from the opensuse
> > OSS-factory tree on a 64-bit arch and get a lot of these warnings:
> >
> > fat.c:325: warning: cast increases required alignment of target type
> > 325:
> > next = le32_to_cpu(*((uint32_t *) buf) & 0x0fffffff);
Hm, I don't know what this code is about, but is it actually correct?
I mean, it masks the value of buf, which is appearently a little-endian
32bit value with 0x0fffffff (which is CPU order). Is that intentional?
Or should it be something like that instead:
next = le32_to_cpu(*((uint32_t *) buf)) & 0x0fffffff;
> > Will there be a proper fix or is this just another of these nice gcc
> > warnings that are superfluous?
>
> GCC is correct warning about that, cause the Makefile asked for that
> kind of warning. The buffer access is always aligned but the compiler
> can't know that. To get rid of it, you would need to memcpy() the integer
> in a variable or access it byte by byte and shift it to an integer
> value. Removing -Wcast-align should be the easiest. :)
--
Greetings Michael.
[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: udev 085 warnings
2006-04-05 9:10 udev 085 warnings Jan Engelhardt
2006-04-05 19:03 ` Kay Sievers
2006-04-06 0:30 ` Michael Buesch
@ 2006-04-06 2:09 ` Kay Sievers
2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2006-04-06 2:09 UTC (permalink / raw)
To: linux-hotplug
On Thu, Apr 06, 2006 at 02:30:41AM +0200, Michael Buesch wrote:
> On Wednesday 05 April 2006 21:03, Kay Sievers wrote:
> > On Wed, Apr 05, 2006 at 11:10:40AM +0200, Jan Engelhardt wrote:
> > > I am currently compiling udev-085-14.src.rpm from the opensuse
> > > OSS-factory tree on a 64-bit arch and get a lot of these warnings:
> > >
> > > fat.c:325: warning: cast increases required alignment of target type
> > > 325:
> > > next = le32_to_cpu(*((uint32_t *) buf) & 0x0fffffff);
>
> Hm, I don't know what this code is about, but is it actually correct?
> I mean, it masks the value of buf, which is appearently a little-endian
> 32bit value with 0x0fffffff (which is CPU order). Is that intentional?
> Or should it be something like that instead:
> next = le32_to_cpu(*((uint32_t *) buf)) & 0x0fffffff;
I fixed it already while looking for the warning. :)
Thanks,
Kay
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 4+ messages in thread