This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bug fix for g++.old-deja/g++.brendan/new2.C


Joern

Joern Rennecke wrote:
> 
> Wed Jan 31 13:02:52 2001  J"orn Rennecke <amylaar@redhat.com>
> 
>         * g++.old-deja/g++.brendan/new2.C (main): Expect int to be 2 bytes
>         if __INT_MAX__ is 32767.
> 
> Index: g++.old-deja/g++.brendan/new2.C
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/gcc/testsuite/g++.old-deja/g++.brendan/new2.C,v
> retrieving revision 1.9
> diff -p -r1.9 new2.C
> *** new2.C      2000/10/16 22:12:01     1.9
> --- new2.C      2001/01/31 13:02:36
> *************** int main ()
> *** 35,43 ****
> --- 35,49 ----
>         base*           base_ptr;
>         derived*        derived_ptr;
> 
> + #if __INT_MAX__ == 32767
> +       expected_size = 2;
> +       base_ptr = new base;
> +       expected_size = 4;
> + #else
>         expected_size = 4;
>         base_ptr = new base;
>         expected_size = 8;
> + #endif
>         derived_ptr = new derived ();
> 
>         if ((new_call_count != 2) || (errors != 0))

Any reason you don't use sizeof (int) and 2 * sizeof (int) respectively?

Graham

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]