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]
Other format: [Raw text]

Re: [testsuite/C] check target supports large long double and fix Wconversion tests failures


"Manuel López-Ibáñez" <lopezibanez@gmail.com> writes:

| On 02/12/06, Jakub Jelinek <jakub@redhat.com> wrote:
| > On Sat, Dec 02, 2006 at 04:55:47AM +0000, Manuel L?pez-Ib??ez wrote:
| > >    fuc (-1); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
| > >    uc = -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
| > > -  fuc ('\xa0'); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
| > > -  uc = '\xa0'; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
| > > +  fuc (-92); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
| > > +  uc = -92; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
| > >    uc = x ? 1U : -1; /* { dg-warning "conversion" } */
| > >    /* { dg-warning "negative integer implicitly converted to unsigned type" "" { target *-*-* } 25 } */
| > >    uc = x ? SCHAR_MIN : 1U; /* { dg-warning "conversion" } */
| > > @@ -59,8 +59,8 @@ void h (int x)
| > >    fui (sc); /* { dg-warning "conversion" } */
| > >    ui = sc;  /* { dg-warning "conversion" } */
| > >
| > > -  fui ('\xa0');/* { dg-warning "negative integer implicitly converted to unsigned type" } */
| > > -  ui = '\xa0'; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
| > > +  fui (-92);/* { dg-warning "negative integer implicitly converted to unsigned type" } */
| > > +  ui = -92; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
| > >
| > >    fsi (si);
| > >    fui (ui);
| >
| > I think you want to add instead -fsigned-char to dg-options in this test.
| > There is no point in testing two different negative integers, it wants
| > to test negative (signed) char values too.
| >
| 
| I am not sure if I understand correctly what you mean. If you mean
| that we want to test negative (signed) char values such as '\xa0', the
| discussion that resulted in this patch is that char constants are of
| type int. Thus, testing with -fsigned-char is the same as using a
| negative integer. If this is true, I still prefer the current form so
| we don't have to force anything on the target.

There is an important point, however:  If with -fsigned-char, the
resulting value of the literal is negative, them we have portability
problem.  And we better detect that.  Note that the test here is about
testing a literal character, not just a random integer.
Consequently, I think Jakub's suggestion still holds.

-- Gaby


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