[gccsdk] GCC 4.7.4 Rel 4: isblank()

Duncan Moore duncan.moore at gmx.com
Thu Jul 9 03:44:03 PDT 2020


First of all, many thanks to everyone who's contributed to the latest
release.

There are a couple of issues with isblank():

1) In <ctype.h>, isblank() is incorrectly defined the same as isspace():
    #  define isspace(c) (__ctype[(int) (c)] & ___ctype_white)
    #  define isblank(c) (__ctype[(int) (c)] & ___ctype_white)

2) When there's a function pointer to isblank(), I get a link failure:
"undefined reference to `isblank'".

So this program:

#include <stdio.h>
#include <ctype.h>
int main(void) {
   int (*space)(int)=isspace;
   int (*blank)(int)=isblank;       // Fails to link.

   printf("%i\n",!!isspace('\n'));
   printf("%i\n",!!space('\n'));

   printf("%i\n",!!isblank('\n'));
   printf("%i\n",!!blank('\n'));    // Fails to link.

   return 0;
}

should give:

1
1
0
0

whereas, if the 2 lines with comments are removed, I get:

1
1
1

and it fails to link otherwise.

Regards
Duncan Moore

gcc (GCCSDK GCC 4.7.4 Release 4) 4.7.4
SharedUnixLibrary 1.16
VirtualRPC-AdjustSA RISCOS 4.39




More information about the gcc mailing list