Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Re: Writing portable Code for Glibc and 32/64 bit
@ 1998-11-21 20:12 Greg Lindahl
  1998-11-21 20:40 ` Dave Gilbert
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Lindahl @ 1998-11-21 20:12 UTC (permalink / raw)
  To: axp-list

> A portability problem I have tried to figure out a good soloution for is
> that of structure sizes in arrays - e.g.
> 
> struct frob {
>   void *a;
>   void *b;
>   int x;
>   int dummy;
#ifdef PTRS_ARE_64_BITS
    void *__ignore_me;
#endif
> }

However, I would first prove to myself that it makes a significant
difference in the run-time of my program to waste all that memory. And
it's hard to believe that this is worth hacking the compiler chain to
do this kind of thing for other people.

-- g


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Writing portable Code for Glibc and 32/64 bit
@ 1998-11-21 20:51 Greg Lindahl
  0 siblings, 0 replies; 8+ messages in thread
From: Greg Lindahl @ 1998-11-21 20:51 UTC (permalink / raw)
  To: axp-list

> Yeh - but what about the size of int's and all the possible alignment
> issues in a more general case.

You can't solve the general case without a bit more work, which is
probably unnecessary: compile a test program with this structure in
it, and print out the size. Then start adding various padding
variables and see when you get what you want. That's the kind of thing
that configure helps you out with.

-- g


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Writing portable Code for Glibc and 32/64 bit
@ 1998-11-20 11:03 y0000218
  1998-11-20 15:02 ` Stefan Schroepfer
  0 siblings, 1 reply; 8+ messages in thread
From: y0000218 @ 1998-11-20 11:03 UTC (permalink / raw)


Hi,

for a friend that has to implement transparent network cryptography for
Linux soon: Where can I find documents that tell him how to code
good, portable code for glibc and 32/64 bit Linux? It there a quick
introductory paper to the most important things to remember and a longer
one explaning what to do and what not? 

Thanks for any hints,

Olaf


-- 
"The number of Unix installations       Olaf Schnapauff,
has grown to 10, with more expected."   O.Schnapauff@tu-bs.de  
- The Unix Programmer's Manual,1972     http://www.tu-bs.de/~c0033014/
       See Web page and keyservers  for pgp public key


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1998-11-21 20:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-11-21 20:12 Writing portable Code for Glibc and 32/64 bit Greg Lindahl
1998-11-21 20:40 ` Dave Gilbert
1998-11-21 20:47   ` Maciej W. Rozycki
  -- strict thread matches above, loose matches on Subject: below --
1998-11-21 20:51 Greg Lindahl
1998-11-20 11:03 y0000218
1998-11-20 15:02 ` Stefan Schroepfer
1998-11-20 18:53   ` Jeff DeMaagd
1998-11-21 13:18     ` Dave Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox