gettext should not be a builtin

Andris Pavenis pavenis@latnet.lv
Wed Jul 2 06:55:00 GMT 2003


On Tuesday 01 July 2003 21:55, Joseph S. Myers wrote:
> On Tue, 1 Jul 2003, DJ Delorie wrote:
> > 1) Compiler error received:
> >
> >   In file included from test.c:1:
> >   c:/ab/djgpp/include/conio.h:74: error:
> >     nonnull argument references non-pointer operand (arg 1, operand 1)
>
> Changing handle_nonnull_attribute to check ATTR_FLAG_BUILT_IN before
> giving errors, as handle_format_arg_attribute does, should fix the
> problem.

I reproduced error message also under Linux by putting DJGPP prototype of gettext()
from conio.h in a separate file with CVS HEAD and GCC-3.3 branch. So further tests done
under Linux.

Did You mean this?

--- c-common.c~1	2003-06-26 12:03:20.000000000 +0300
+++ c-common.c	2003-07-02 09:44:35.000000000 +0300
@@ -5745,8 +5745,9 @@ handle_nonnull_attribute (tree *node, tr
 
           if (TREE_CODE (TREE_VALUE (argument)) != POINTER_TYPE)
 	    {
-	      error ("nonnull argument references non-pointer operand (arg %lu, operand %lu)",
-		   (unsigned long) attr_arg_num, (unsigned long) arg_num);
+              if (!(flags & (int) ATTR_FLAG_BUILT_IN))
+  	          error ("nonnull argument references non-pointer operand (arg %lu, operand %lu)",
+		       (unsigned long) attr_arg_num, (unsigned long) arg_num);
 	      *no_add_attrs = true;
 	      return NULL_TREE;
 	    }


At least it seems to silence mentioned error message under Linux (gcc-3.4 20030630).
No tests done for DJGPP yet.

Also: what about other error messages from this function? Should they also be 
handled in a similar way?

Andris



More information about the Gcc mailing list