#1144811 imagemagick: test_float_t.sh script contains invalid C code on sh4

#1144811#5
Date:
2026-08-19 06:20:33 UTC
From:
To:
Hi,

the script debian/test_float_t.sh contains invalid C code which FTBFS with:

make[1]: Entering directory '/home/glaubitz/imagemagick-sh4-new/imagemagick-7.1.2.29+dfsg2'
/tmp/tmp.ynajwKcpye/float.c: In function 'main':
/tmp/tmp.ynajwKcpye/float.c:13:9: error: duplicate case value
   13 |         case(sizeof(long double)):
      |         ^~~~
/tmp/tmp.ynajwKcpye/float.c:10:9: note: previously used here
   10 |         case(sizeof(double)):
      |         ^~~~

The C code in the script looks like this:

int main()
{
    switch(sizeof(float_t)) {
        case(sizeof(float)):
            printf("float");
            return 0;
        case(sizeof(double)):
            printf("double");
            return 0;
        case(sizeof(long double)):
            printf("long double");
            return 0;
        default:
            printf("????");
            return 1;
    }
}

The code becomes invalid the moment any of these types have the same size
so that the switch statement becomes ambigious.

FWIW, the problem is currently obscured on the buildds due to an internal
compiler error that is fixed with GCC 17 [1].

Adrian

#1144811#10
Date:
2026-08-19 21:58:40 UTC
From:
To:
Le mercredi 19 août 2026, 08:20:33 heure d’été d’Europe centrale John Paul Adrian Glaubitz a écrit :

Note that:
according to doc on any arch float size is different then double

I am curious to know size of long double...

rouca

#1144811#15
Date:
2026-08-19 21:58:40 UTC
From:
To:
Le mercredi 19 août 2026, 08:20:33 heure d’été d’Europe centrale John Paul Adrian Glaubitz a écrit :

Note that:
according to doc on any arch float size is different then double

I am curious to know size of long double...

rouca