
*** c-decl.c.orig	Fri May  4 11:02:37 1990
--- c-decl.c	Tue May 15 14:07:48 1990
***************
*** 2197,2203 ****
        /* Note MAXINDEX  is really the maximum index,
  	 one less than the size.  */
        if (TREE_CODE (initial_value) == STRING_CST)
! 	maxindex = build_int_2 (TREE_STRING_LENGTH (initial_value) - 1, 0);
        else if (TREE_CODE (initial_value) == CONSTRUCTOR)
  	{
  	  register int nelts
--- 2197,2210 ----
        /* Note MAXINDEX  is really the maximum index,
  	 one less than the size.  */
        if (TREE_CODE (initial_value) == STRING_CST)
! 	{
! 	  int nchars = TREE_STRING_LENGTH (initial_value);
! 	  if (TREE_TYPE (initial_value)
! 	      && TREE_CODE (TREE_TYPE (initial_value)) == ARRAY_TYPE
! 	      && TREE_TYPE (TREE_TYPE (initial_value)) == integer_type_node)
! 	    nchars /= UNITS_PER_WORD;
! 	  maxindex = build_int_2 (nchars - 1, 0);
! 	}
        else if (TREE_CODE (initial_value) == CONSTRUCTOR)
  	{
  	  register int nelts

This came from RMS and fixes things like sizeof(L"").

*** c-parse.y	Tue May 15 08:23:57 1990
--- c-parse.y.orig	Tue May 15 14:12:16 1990
***************
*** 1358,1364 ****
    register int length = 1;
    int wide_length = 0;
    int wide_flag = 0;
-   int nchars;
  
    if (TREE_CHAIN (strings))
      {
--- 1358,1363 ----
***************
*** 1372,1378 ****
  	{
  	  if (TREE_TYPE (t) == int_array_type_node)
  	    {
! 	      wide_length += (TREE_STRING_LENGTH (t) - UNITS_PER_WORD);
  	      wide_flag = 1;
  	    }
  	  else
--- 1371,1377 ----
  	{
  	  if (TREE_TYPE (t) == int_array_type_node)
  	    {
! 	      wide_length += (TREE_STRING_LENGTH (t) - 1);
  	      wide_flag = 1;
  	    }
  	  else
***************
*** 1422,1430 ****
  	wide_flag = 1;
      }
  
-   /* Compute the number of elements, for the array type.  */ 
-   nchars = wide_flag ? length / UNITS_PER_WORD : length;
- 
    /* Create the array type for the string constant.
       -Wwrite-strings says make the string constant an array of const char
       so that copying it to a non-const pointer will get a warning.  */
--- 1421,1426 ----
***************
*** 1435,1446 ****
  			      1, 0);
        TREE_TYPE (value)
  	= build_array_type (elements,
! 			    build_index_type (build_int_2 (nchars - 1, 0)));
      }
    else
      TREE_TYPE (value)
        = build_array_type (wide_flag ? integer_type_node : char_type_node,
! 			  build_index_type (build_int_2 (nchars - 1, 0)));
    TREE_LITERAL (value) = 1;
    TREE_STATIC (value) = 1;
    return value;
--- 1431,1442 ----
  			      1, 0);
        TREE_TYPE (value)
  	= build_array_type (elements,
! 			    build_index_type (build_int_2 (length - 1, 0)));
      }
    else
      TREE_TYPE (value)
        = build_array_type (wide_flag ? integer_type_node : char_type_node,
! 			  build_index_type (build_int_2 (length - 1, 0)));
    TREE_LITERAL (value) = 1;
    TREE_STATIC (value) = 1;
    return value;

