NetBSD Problem Report #38210

From martin@duskware.de  Mon Mar 10 11:07:13 2008
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 8005563B8E3
	for <gnats-bugs@gnats.netbsd.org>; Mon, 10 Mar 2008 11:07:13 +0000 (UTC)
Message-Id: <20080310110531.23F9563B8E3@narn.NetBSD.org>
Date: Mon, 10 Mar 2008 11:05:31 +0000 (UTC)
From: srcshelton@gmail.com
Reply-To: srcshelton@gmail.com
To: netbsd-bugs-owner@NetBSD.org
Subject: textproc/grep-2.5.3 fails to compile on IRIX (2.5.1nb4 built correctly)
X-Send-Pr-Version: www-1.0

>Number:         38210
>Category:       pkg
>Synopsis:       textproc/grep-2.5.3 fails to compile on IRIX (2.5.1nb4 built correctly)
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    irix-pkg-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 10 11:10:00 +0000 2008
>Closed-Date:    Tue Mar 11 02:24:47 +0000 2008
>Last-Modified:  Tue Mar 11 22:20:02 +0000 2008
>Originator:     Stuart Shelton
>Release:        pkgsrc latest from CVS
>Organization:
>Environment:
IRIX64 octane 6.5 07202013 IP30; IRIX 6.5.30; MIPSpro Compilers: Version 7.4.4m
>Description:

grep-2.5.3 fails with:

source='search.c' object='search.o' libtool=no  DEPDIR=.deps depmode=sgi /bin/ksh ../depcomp  cc -DHAVE_CONFIG_H -I. -I.. -I../intl -I../lib -DLOCALEDIR=\"/usr/bsd/share/locale\"   -I/usr/bsd/include -D__inline__=inline -I/usr/bsd/include  -c99 -O2 -n32 -mips4 -r14000 -apo -float_const -use_readonly_const -TARG:isa=mips4:platform=ip30:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff 1174,1183,1185,1552,3970,3968 -n32 -I/usr/bsd/include -c search.c
cc-1164 cc: WARNING File = search.c, Line = 169
  Argument of type "const char *" is incompatible with parameter of type
          "char *restrict".

              wcrtomb(buf + i, wc, &cur_state);
                      ^

cc-1117 cc: ERROR File = search.c, Line = 283
  An expression appears after a "return" in a "void" function.

    return GEAcompile (pattern, size,
           ^

cc-1117 cc: ERROR File = search.c, Line = 289
  An expression appears after a "return" in a "void" function.

    return GEAcompile (pattern, size, RE_SYNTAX_AWK);
           ^

cc-1117 cc: ERROR File = search.c, Line = 294
  An expression appears after a "return" in a "void" function.

    return GEAcompile (pattern, size, RE_SYNTAX_POSIX_EGREP);
           ^

3 errors detected in the compilation of "search.c".
*** Error code 2

Stop.
bmake: stopped in /usr/bsd/var/tmp/textproc/grep/work/grep-2.5.3/src
*** Error code 1

Stop.
bmake: stopped in /usr/bsd/var/tmp/textproc/grep/work/grep-2.5.3
*** Error code 1

Stop.
bmake: stopped in /usr/bsd/var/tmp/textproc/grep/work/grep-2.5.3
*** Error code 1

Stop.
bmake: stopped in /usr/bsd/src/textproc/grep
*** Error code 1

Stop.
bmake: stopped in /usr/bsd/src/textproc/grep


... and this appears to be correct!

In "grep.h", we have the following definitions:

#ifdef GREP_PROGRAM
# define COMPILE_FCT(f) static COMPILE_RET f COMPILE_ARGS
#else /* !GREP_PROGRAM */
# define COMPILE_FCT(f) COMPILE_RET compile COMPILE_ARGS

... below:

#define COMPILE_RET void

... which expands out to:

# define COMPILE_FCT(f) static void f (char const *pattern, size_t size)
# define COMPILE_FCT(f) void compile (char const *pattern, size_t size)

... so when the source contains:

COMPILE_FCT(Ecompile)
{
  return GEAcompile (pattern, size, RE_SYNTAX_POSIX_EGREP);
}

... this becomes:

static void Ecompile(char const *pattern, size_t size)
{
  return GEAcompile (pattern, size, RE_SYNTAX_POSIX_EGREP);
}

... which the compiler is classifying as an ERROR :(
>How-To-Repeat:

>Fix:

GEAcompile also has a return type of COMPILE_RET, which is #defined to be void - so presumably removing the 'return' statements should fix the problem without breaking the code.

NB:

mk/compiler/mipspro.mk has line 46:

CC_VERSION!=            ${CCPATH} -version 2>&1 | ${GREP} '^MIPSpro'

... which breaks when upgrading 'grep', since this is evaluated after the older grep has been removed, but before the newer one has been installed.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->bouyer
Responsible-Changed-By: obache@NetBSD.org
Responsible-Changed-When: Mon, 10 Mar 2008 12:00:48 +0000
Responsible-Changed-Why:
Over to maintainer.


Responsible-Changed-From-To: bouyer->irix-pkg-people
Responsible-Changed-By: tnn@NetBSD.org
Responsible-Changed-When: Mon, 10 Mar 2008 14:46:13 +0000
Responsible-Changed-Why:
I'll have a look.


From: Tobias Nygren <tnn@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/38210 CVS commit: pkgsrc/textproc/grep
Date: Tue, 11 Mar 2008 02:18:23 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	tnn
 Date:		Tue Mar 11 02:18:22 UTC 2008

 Modified Files:
 	pkgsrc/textproc/grep: distinfo
 Added Files:
 	pkgsrc/textproc/grep/patches: patch-aa

 Log Message:
 MIPSPro doesn't like code such as:

 void foo(void) {}
 void bar(void) { return foo(); }

 Stripping away the return makes it happy. PR pkg/38210.


 To generate a diff of this commit:
 cvs rdiff -r1.8 -r1.9 pkgsrc/textproc/grep/distinfo
 cvs rdiff -r0 -r1.5 pkgsrc/textproc/grep/patches/patch-aa

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: tnn@NetBSD.org
State-Changed-When: Tue, 11 Mar 2008 02:24:47 +0000
State-Changed-Why:
Don't have MIPSPro to test with, but fixed it the way you suggested.


From: "Stuart Shelton" <srcshelton@gmail.com>
To: gnats-bugs@netbsd.org
Cc: irix-pkg-people@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: PR/38210 CVS commit: pkgsrc/textproc/grep
Date: Tue, 11 Mar 2008 13:14:15 +0000

 security/libgcrypt has the same problem:

 cc-1117 cc: ERROR File = visibility.c, Line = 702
   An expression appears after a "return" in a "void" function.

     return _gcry_md_hash_buffer (algo, digest, buffer, length);
            ^

 cc-1117 cc: ERROR File = visibility.c, Line = 851
   An expression appears after a "return" in a "void" function.

     return _gcry_ac_io_init_va (ac_io, mode, type, ap);
            ^

 2 errors detected in the compilation of "visibility.c".

 ... and again, the build is successful is the "return" keyword is
 removed (the functions called are void functions in any case).


 On 11/03/2008, Tobias Nygren <tnn@netbsd.org> wrote:
 > The following reply was made to PR pkg/38210; it has been noted by GNATS.
 >
 >  From: Tobias Nygren <tnn@netbsd.org>
 >  To: gnats-bugs@gnats.NetBSD.org
 >  Cc:
 >  Subject: PR/38210 CVS commit: pkgsrc/textproc/grep
 >  Date: Tue, 11 Mar 2008 02:18:23 +0000 (UTC)
 >
 >   Module Name:   pkgsrc
 >   Committed By:  tnn
 >   Date:          Tue Mar 11 02:18:22 UTC 2008
 >
 >   Modified Files:
 >         pkgsrc/textproc/grep: distinfo
 >   Added Files:
 >         pkgsrc/textproc/grep/patches: patch-aa
 >
 >   Log Message:
 >   MIPSPro doesn't like code such as:
 >
 >   void foo(void) {}
 >   void bar(void) { return foo(); }
 >
 >   Stripping away the return makes it happy. PR pkg/38210.
 >
 >
 >   To generate a diff of this commit:
 >   cvs rdiff -r1.8 -r1.9 pkgsrc/textproc/grep/distinfo
 >   cvs rdiff -r0 -r1.5 pkgsrc/textproc/grep/patches/patch-aa
 >
 >   Please note that diffs are not public domain; they are subject to the
 >   copyright notices on the relevant files.
 >
 >

From: Tobias Nygren <tnn@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/38210 CVS commit: pkgsrc/security/libgcrypt
Date: Tue, 11 Mar 2008 22:19:54 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	tnn
 Date:		Tue Mar 11 22:19:54 UTC 2008

 Modified Files:
 	pkgsrc/security/libgcrypt: distinfo
 Added Files:
 	pkgsrc/security/libgcrypt/patches: patch-ah

 Log Message:
 Fix build with MIPSPro. PR pkg/38210.


 To generate a diff of this commit:
 cvs rdiff -r1.22 -r1.23 pkgsrc/security/libgcrypt/distinfo
 cvs rdiff -r0 -r1.3 pkgsrc/security/libgcrypt/patches/patch-ah

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.