NetBSD Problem Report #59223

From www@netbsd.org  Wed Mar 26 17:22:30 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 8B8D51A9239
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 26 Mar 2025 17:22:30 +0000 (UTC)
Message-Id: <20250326172229.00A7E1A923D@mollari.NetBSD.org>
Date: Wed, 26 Mar 2025 17:22:28 +0000 (UTC)
From: cryintothebluesky@gmail.com
Reply-To: cryintothebluesky@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Build failure on Solaris-11.4 for src/include/regex.h
X-Send-Pr-Version: www-1.0

>Number:         59223
>Category:       bin
>Synopsis:       Build failure on Solaris-11.4 for src/include/regex.h
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 26 17:25:00 +0000 2025
>Last-Modified:  Wed Mar 26 18:15:00 +0000 2025
>Originator:     Sad Clouds
>Release:        NetBSD-10
>Organization:
>Environment:
SunOS t4-node1 5.11 11.4.42.111.0 sun4v sparc sun4v non-virtualized

>Description:
Building NetBSD-10 with build.sh fails:

In file included from /opt/netbsd/netbsd-10-src/tools/compat/regex.h:3,
                 from /opt/netbsd/netbsd-10-src/tools/mandoc/../../external/bsd/mdocml/bin/mandoc/../../dist/dba_read.c:22:
/opt/netbsd/netbsd-10-src/tools/compat/../../include/regex.h:135:14: error: expected ';' before 'int'
  135 | __BEGIN_DECLS
      |              ^
      |              ;
  136 | int     regcomp(regex_t * __restrict, const char * __restrict, int);
      | ~~~           
/opt/netbsd/netbsd-10-src/tools/compat/../../include/regex.h:145:12: error: expected ';' before 'extern'
  145 | __END_DECLS
      |            ^
      |            ;


I think these macros are not portable and probably obsolete.
>How-To-Repeat:

>Fix:
$ diff -u src/include/regex.h.orig src/include/regex.h
--- src/include/regex.h.orig    2025-03-26 09:19:45.655609768 +0000
+++ src/include/regex.h 2025-03-26 09:15:38.998649758 +0000
@@ -132,7 +132,10 @@
 #define        REG_LARGE       01000   /* force large representation */
 #define        REG_BACKR       02000   /* force use of backref code */

-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 int    regcomp(regex_t * __restrict, const char * __restrict, int);
 size_t regerror(int, const regex_t * __restrict, char * __restrict, size_t);
 int    regexec(const regex_t * __restrict,
@@ -142,6 +145,9 @@
 ssize_t regnsub(char *, size_t, const char *, const regmatch_t *, const char *);
 ssize_t regasub(char **buf, const char *, const regmatch_t *, const char *);
 #endif
-__END_DECLS

+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
 #endif /* !_REGEX_H_ */

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/59223: Build failure on Solaris-11.4 for src/include/regex.h
Date: Wed, 26 Mar 2025 18:32:51 +0100

 On Wed, Mar 26, 2025 at 05:25:00PM +0000, cryintothebluesky@gmail.com wrote:
 > I think these macros are not portable and probably obsolete.

 They are NetBSD system header files specific and NOT obsolete.

 The compat version used here should include compat_defs.h somhow to get the
 tools compat version of them (which is empty).

 Martin

From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,
 cryintothebluesky@gmail.com
Subject: Re: bin/59223: Build failure on Solaris-11.4 for src/include/regex.h
Date: Wed, 26 Mar 2025 14:10:59 -0400

 On 2025-03-26 1:35 pm, Martin Husemann via gnats wrote:
 > The following reply was made to PR bin/59223; it has been noted by 
 > GNATS.
 > 
 > From: Martin Husemann <martin@duskware.de>
 > To: gnats-bugs@netbsd.org
 > Cc:
 > Subject: Re: bin/59223: Build failure on Solaris-11.4 for 
 > src/include/regex.h
 > Date: Wed, 26 Mar 2025 18:32:51 +0100
 > 
 >  On Wed, Mar 26, 2025 at 05:25:00PM +0000, cryintothebluesky@gmail.com 
 > wrote:
 >  > I think these macros are not portable and probably obsolete.
 > 
 >  They are NetBSD system header files specific and NOT obsolete.
 > 
 >  The compat version used here should include compat_defs.h somhow to 
 > get the
 >  tools compat version of them (which is empty).
 > 
 >  Martin

 Perhaps the mdocml config.h should include nbtool_config.h?

 -- 
 christos

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.