This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

combine_strings doesn't work for OBJC_STRING_CST


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]