delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/07/02/02:58:08

From: Andris Pavenis <pavenis AT latnet DOT lv>
To: "Joseph S. Myers" <jsm28 AT cam DOT ac DOT uk>, DJ Delorie <dj AT redhat DOT com>,
djgpp-workers AT delorie DOT com
Subject: Re: gettext should not be a builtin
Date: Wed, 2 Jul 2003 09:55:09 +0300
User-Agent: KMail/1.5.2
Cc: gcc AT gcc DOT gnu DOT org
References: <200307011438 DOT h61Ecgj08214 AT greed DOT delorie DOT com> <200307011850 DOT h61IoUR12534 AT greed DOT delorie DOT com> <Pine DOT LNX DOT 4 DOT 56 DOT 0307011951230 DOT 26914 AT kern DOT srcf DOT societies DOT cam DOT ac DOT uk>
In-Reply-To: <Pine.LNX.4.56.0307011951230.26914@kern.srcf.societies.cam.ac.uk>
MIME-Version: 1.0
Message-Id: <200307020955.09871.pavenis@latnet.lv>
Reply-To: djgpp-workers AT delorie DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019