linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* udev compile problem: udevd
@ 2004-12-20 17:40 Thomas Strösslin
  2004-12-20 20:17 ` Kay Sievers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Strösslin @ 2004-12-20 17:40 UTC (permalink / raw)
  To: linux-hotplug

Hi,

I failed to compile udev-050.
in udevd.h, the structure hotplug_msg{} contains:

	char envbuf[];

This does not compile on my system (SuSE 7.3, gcc 2.95.3)

It does compile if you replace "envbuf[]" with "*envbuf"

cheers,
tom


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
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 compile problem: udevd
  2004-12-20 17:40 udev compile problem: udevd Thomas Strösslin
@ 2004-12-20 20:17 ` Kay Sievers
  2004-12-20 23:29 ` Dave Dodge
  2004-12-21  1:33 ` Kay Sievers
  2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2004-12-20 20:17 UTC (permalink / raw)
  To: linux-hotplug

On Mon, 2004-12-20 at 18:40 +0100, Thomas Strösslin wrote:
> Hi,
> 
> I failed to compile udev-050.
> in udevd.h, the structure hotplug_msg{} contains:
> 
> 	char envbuf[];
> 
> This does not compile on my system (SuSE 7.3, gcc 2.95.3)
> 
> It does compile if you replace "envbuf[]" with "*envbuf"

A variable sized array is not a pointer! You will get a different
sizeof(), which may cause problems.

Kay



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
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 compile problem: udevd
  2004-12-20 17:40 udev compile problem: udevd Thomas Strösslin
  2004-12-20 20:17 ` Kay Sievers
@ 2004-12-20 23:29 ` Dave Dodge
  2004-12-21  1:33 ` Kay Sievers
  2 siblings, 0 replies; 4+ messages in thread
From: Dave Dodge @ 2004-12-20 23:29 UTC (permalink / raw)
  To: linux-hotplug

On Mon, Dec 20, 2004 at 09:17:39PM +0100, Kay Sievers wrote:
> A variable sized array is not a pointer! You will get a different
> sizeof(), which may cause problems.

Beware that gcc does not conform to C99 in regards to the size of a
structure containing a flexible array.  For example:

  struct foo{ int i; char c; char arr[]; };

gcc-3.4.2/i386 reports sizeof(struct foo) as 8 and offsetof(struct foo,arr)
as 5; but C99 requires those values to be the same.  More here:

  http://gcc.gnu.org/gcc-3.4/c99status.html
  http://gcc.gnu.org/ml/gcc/2002-05/msg02844.html

                                                  -Dave Dodge


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
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 compile problem: udevd
  2004-12-20 17:40 udev compile problem: udevd Thomas Strösslin
  2004-12-20 20:17 ` Kay Sievers
  2004-12-20 23:29 ` Dave Dodge
@ 2004-12-21  1:33 ` Kay Sievers
  2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2004-12-21  1:33 UTC (permalink / raw)
  To: linux-hotplug

On Mon, 2004-12-20 at 18:29 -0500, Dave Dodge wrote:
> On Mon, Dec 20, 2004 at 09:17:39PM +0100, Kay Sievers wrote:
> > A variable sized array is not a pointer! You will get a different
> > sizeof(), which may cause problems.
> 
> Beware that gcc does not conform to C99 in regards to the size of a
> structure containing a flexible array.  For example:
> 
>   struct foo{ int i; char c; char arr[]; };
> 
> gcc-3.4.2/i386 reports sizeof(struct foo) as 8 and offsetof(struct foo,arr)
> as 5; but C99 requires those values to be the same.  More here:
> 
>   http://gcc.gnu.org/gcc-3.4/c99status.html
>   http://gcc.gnu.org/ml/gcc/2002-05/msg02844.html

Interesting. Thanks for pointing this out.

Kay



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
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

end of thread, other threads:[~2004-12-21  1:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-20 17:40 udev compile problem: udevd Thomas Strösslin
2004-12-20 20:17 ` Kay Sievers
2004-12-20 23:29 ` Dave Dodge
2004-12-21  1:33 ` Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).