From: Andris Pavenis To: "Joseph S. Myers" , DJ Delorie , 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> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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