|
From: Chad S. <ho...@ho...> - 2001-01-05 16:24:53
|
>From: "Ioannis Vranos" <no...@ya...>
>Reply-To: dev...@li...
>To: <dev...@li...>
>Subject: RE: [Dev-C++] The new C99 Standard
>Date: Fri, 5 Jan 2001 12:02:38 +0200
>
> > -----Original Message-----
> > From: dev...@li...
> > [mailto:dev...@li...]On Behalf Of James
> > Gordon
> > Sent: Friday, January 05, 2001 10:40 AM
> > To: 'dev...@li...'
> > Subject: RE: [Dev-C++] The new C99 Standard
> >
> >
> > Taking the example
> >
> > drawline((struct point) {.y=2, .x=1}, (struct point) {.x=3, .y=1});
> >
> > Is easier than
> >
> > {
> > struct point mypoint1, mypoint2;
> > mypoint1.y = 2;
> > mypoint1.x = 1;
> > mypoint2.y = 3;
> > mypoint2.x = 1;
> > drawline(mypoint1, mypoint2);
> > ... 100's of lines later
> > } <- Now mypoint1 & 2 are destroyed.
> >
>
>Do you find these:
>
>struct {int a[2], b}; x[]={[0].a = {1}, [1].a[0] = 2};
>
>
> struct s { int n; double d[]; };
>------------------------------------
>
> struct s *s1=malloc(sizeof(struct s)+64); //64 is for the d[]
> s1->d[0]=...
>
>as badly needed too?
>
> > Why does long long corrupt existing code?
>
>:))
>Because the previous standard assumed long as the biggest integer and
>programs were written with that in mind. Obviously we have different
>opinions on the matter but is long long the biggest integer? Do not forget
>that more integers were introduced (breaking further the compatibility):
But the size of a long didn't change with this standard. It simply allows
new code to specify exactly how much memory should be used for a particular
variable. A long is still the same size as it always has been, and as such
existing code won't "break" because new data types were introduced. The
whole reason for the new data types is probably due to the fact that pretty
soon processors will be optimised for 64 bit computations, and as such, the
int will go from being 32 bits to being 64 bits, and that could cause
programs written on these new platforms to be uncompileable on 32 bit
platforms if the writer of the program made assumtions about the size of an
int. This way there is no abiguity as to how much space a certain varaible
needs to utilize in order for the program to run properly. It also prevents
massive code rewrites in those cases.
I guess my point it that adding new data types doesn't in any way change
existing functionality, so I don't see where your claim that the C99
standards breaks compatibility has much of a leg to stand on.
Chad Simmons
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
|