This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
combine_strings doesn't work for OBJC_STRING_CST
- To: gcc at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org
- Subject: combine_strings doesn't work for OBJC_STRING_CST
- From: Ovidiu Predescu <ovidiu at cup dot hp dot com>
- Date: Sat, 29 Jul 2000 22:48:07 -0700
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/
PGP signature