]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/enquire.c
Edit comment.
[gcc.git] / gcc / enquire.c
index 8e9c92425c5eaea88515c424509dd5b72a5c88b2..037dc1e47f471743f74dbda91d29acdce6757326 100644 (file)
    Support NO_LONG_DOUBLE_IO in f_define and f_rep; new fn fake_f_rep, Apr 92.
    Enclose -f output in #ifndef _FLOAT_H___, Richard Stallman, May 92.
 
+   Add #undef before every #define, Jim Wilson, Dec 92.
+
+   Changes by Paul Eggert, installed Feb 93:
+   (fake_f_rep): Clear all of u, initially.  Make the ints in u unsigned.
+   (f_define): Use ordinary constants for long double
+   if it's same width as double.  Make __convert_long_double_i unsigned.
+
    COMPILING
    With luck and a following wind, just the following will work:
        cc enquire.c -o enquire
@@ -780,6 +787,7 @@ Procedure i_define(desc, extra, sort, name, val, lim, req, mark)
      char *desc, *extra, *sort, *name; long val, lim, req; char *mark; {
        /* Produce a #define for a signed int type */
        describe(desc, extra);
+       printf("#undef %s%s\n", sort, name);
        if (val >= 0) {
                printf("#define %s%s %ld%s\n", sort, name, val, mark);
        } else if (val + lim < 0) {
@@ -807,6 +815,7 @@ Procedure u_define(desc, extra, sort, name, val, req, mark)
      char *desc, *extra, *sort, *name; unsigned long val, req; char *mark; {
        /* Produce a #define for an unsigned value */
        describe(desc, extra);
+       printf("#undef %s%s\n", sort, name);
        printf("#define %s%s %lu%s%s\n", sort, name, val, U, mark);
        if (val != req) {
                printf("%s*** Verify failed for above #define!\n", co);
@@ -821,15 +830,17 @@ Procedure f_define(desc, extra, sort, name, precision, val, mark)
      Long_double val; char *mark; {
        /* Produce a #define for a float/double/long double */
        describe(desc, extra);
+       printf ("#undef %s%s\n", sort, name);
        if (stdc) {
 #ifdef NO_LONG_DOUBLE_IO
                static int union_defined = 0;
-               if (!strcmp(sort, "LDBL")) {
+               if (sizeof(double) != sizeof(Long_double)
+                   && !strcmp(sort, "LDBL")) {
                        if (!union_defined) {
                                printf("#ifndef __LDBL_UNION__\n");
                                printf("#define __LDBL_UNION__\n");
                                printf("union __convert_long_double {\n");
-                               printf("  int __convert_long_double_i[4];\n");
+                               printf("  unsigned __convert_long_double_i[4];\n");
                                printf("  long double __convert_long_double_d;\n");
                                printf("};\n");
                                printf("#endif\n");
@@ -905,7 +916,8 @@ int exponent(x, fract, exp) Long_double x; double *fract; int *exp; {
 
 char *fake_f_rep(type, val) char *type; Long_double val; {
        static char buf[1024];
-       union { int i[4]; Long_double ld;} u;
+       union { unsigned int i[4]; Long_double ld;} u;
+       u.i[0] = u.i[1] = u.i[2] = u.i[3] = 0;
        u.ld = val;
        sprintf(buf, "(__extension__ ((union __convert_long_double) {0x%x, 0x%x, 0x%x, 0x%x}).__convert_long_double_d)",
                u.i[0], u.i[1], u.i[2], u.i[3]);
This page took 0.030145 seconds and 5 git commands to generate.