combine_strings doesn't work for OBJC_STRING_CST

Ovidiu Predescu ovidiu@cup.hp.com
Sat Jul 29 22:48:00 GMT 2000


Hi,

I just noticed that combine_strings() no longer works for OBJC_STRING_CST tree
nodes. The problem seems to be caused by a check for the node type in the
TREE_STRING_LENGTH and TREE_STRING_POINTER macros, which expect to have as
argument a STRING_CST node.

The problem can be observed by compiling a very simple Objective-C program:

-- file test.m --

#include <stdio.h>
#include <objc/NXConstStr.h>

int main(int argc, void **args)
{
  printf ([@"this is a string\n" cString]);
  return 0;
}

-- end of test.m --

Compile it with gcc -o test test.m -lobjc.

I've added this test program and another one as gcc/testsuite/objc/execute/{str
ing1.m,string2.m}. They both check for the correct behavior of combine_strings.

Rewriting the TREE_STRING_LENGTH and TREE_STRING_POINTER to work with both
STRING_CST and OBJC_STRING_CST could solve the problem. However these macros
are implemented in terms of TREE_CHECK which doesn't allow alternative node
types.

Any idea how to solve the problem?

Thanks,
Ovidiu


-- 
Ovidiu Predescu <ovidiu@cup.hp.com>
http://orion.nsr.hp.com/ (inside HP's firewall only)
http://www.geocities.com/SiliconValley/Monitor/7464/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp00000.pgp
Type: text/x-c
Size: 1486 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20000729/30a7db86/attachment.bin>


More information about the Gcc mailing list