[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: pcb crooked traces





Andrew Poelstra wrote:
Well, the C standard says that long must be ``at least'' 32 bits,
maybe more. To the best of my knowledge, gcc uses a 32-bit long
even on 64-bit systems, to maintain compatibility with old code.
This was true last I checked, a year or two ago.
Tested 5 minutes ago:
[**** ajf@ajf5 ~]
> uname -a
Linux ajf5 2.6.31-19-generic #56-Ubuntu SMP Thu Jan 28 02:39:34 UTC 2010 x86_64 GNU/Linux
[**** ajf@ajf5 ~]
> cat long.c
#include <limits.h>
#include <stdio.h>

int main()
{
   int i;
   long int l;
   long long int L;

   i = INT_MAX;
   printf("i = %d\n", i);
   l = LONG_MAX;
   printf("l = %ld\n", l);
   L = LLONG_MAX;
   printf("L = %lld\n", L);
}
[**** ajf@ajf5 ~]
> ./long
i = 2147483647
l = 9223372036854775807
L = 9223372036854775807
[**** ajf@ajf5 ~]
> exit

long long is ``at least'' 64 bits, which is why gcc does its emulation.


And yes, it might be better to use long long even on 32-bit machines,
if the performance hit is not too great. But we'll have to do testing
to see.


Andrew

_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user



_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user