Thursday, 9 July 2020

[gccsdk] GCC 4.7.4 Rel 4: isblank()

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


_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

No comments:

Post a Comment