Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #22871

Re: struct with one member: padding?

From Ben Pfaff <blp@cs.stanford.edu>
Newsgroups comp.lang.c, comp.unix.programmer
Subject Re: struct with one member: padding?
Date 2012-06-27 09:57 -0700
Message-ID <87bok4wv44.fsf@blp.benpfaff.org> (permalink)
References <jsfckr$drq$1@speranza.aioe.org>

Cross-posted to 2 groups.

Show all headers | View raw


"Mark" <mark_cruzNOTFORSPAM@hotmail.com> writes:

> on many (all?) unix implementations IP address structure is designed this 
> way:
>
> struct in_addr
>   {
>      unsigned long s_addr;
>   };
>
> Does the Standard allow a C comiler to add padding in such
> structure?

Yes.  (I don't know of any implementations that will.)

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

struct with one member: padding? "Mark" <mark_cruzNOTFORSPAM@hotmail.com> - 2012-06-27 12:33 -0400
  Re: struct with one member: padding? John Gordon <gordon@panix.com> - 2012-06-27 16:40 +0000
    Re: struct with one member: padding? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-06-27 18:27 +0100
  Re: struct with one member: padding? Ben Pfaff <blp@cs.stanford.edu> - 2012-06-27 09:57 -0700
  Re: struct with one member: padding? China Blue Meanies <chine.bleu@yahoo.com> - 2012-06-27 12:15 -0700
    Re: struct with one member: padding? Andrew Cooper <amc96@cam.ac.uk> - 2012-06-27 22:52 +0100
      Re: struct with one member: padding? scott@slp53.sl.home (Scott Lurndal) - 2012-06-27 23:42 +0000
  Re: struct with one member: padding? William Ahern <william@wilbur.25thandClement.com> - 2012-06-27 18:03 -0700

csiph-web