Subject: pkg/28791: devel/exctags fails to build
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <martijnb@atlas.ipv6.stack.nl>
List: pkgsrc-bugs
Date: 12/27/2004 19:57:00
>Number:         28791
>Category:       pkg
>Synopsis:       devel/exctags fails to build on -current NetBSD
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 27 19:57:00 +0000 2004
>Originator:     martijnb@atlas.ipv6.stack.nl
>Release:        NetBSD 2.99.11
>Organization:
	
>Environment:
	
	
System: NetBSD atlas.ipv6.stack.nl 2.99.11 NetBSD 2.99.11 (ATLAS) #11: Tue Dec 14 15:38:53 CET 2004 martijnb@atlas.ipv6.stack.nl:/usr/src/sys/arch/i386/compile/ATLAS i386
Architecture: i386
Machine: i386
>Description:
	Package devel/exctags fails to build on -current NetBSD, due to 
	a name clash involving __unused__.
>How-To-Repeat:
        Try to build devel/exctags on a -current machine
>Fix:
        Changed all occurrances of __unused__ to _exctags_unused_. Ditto
	for __printf__.

        Apply the following patch:

(patch-ab through -am are new; I did a 'cvs add' to make cvs diff 
 include them. If this is not the way to go, I'd appreciate a 
 description how to do it correctly :)

Index: distinfo
===================================================================
RCS file: /pub/NetBSD-CVS/pkgsrc/devel/exctags/distinfo,v
retrieving revision 1.7
diff -r1.7 distinfo
5a6,17
> SHA1 (patch-ab) = cfc24b982f7074b3dbf6838530bebc28c8c4428a
> SHA1 (patch-ac) = 9cc788630d5fa51eaca52ea20e3e40c19c715413
> SHA1 (patch-ad) = b4dda940d143072c53e71120aa723da20bd68c09
> SHA1 (patch-ae) = ccf0db002f30709e98215cb68973f2f9b7415cec
> SHA1 (patch-af) = f955eac53ba26fec170aa60a189110288f849f62
> SHA1 (patch-ag) = 3bd7c94020163957603fae2fd74ff010a66482d0
> SHA1 (patch-ah) = 65d9887c9c7297ad22981dc7ecf71ac4f2ad2385
> SHA1 (patch-ai) = 483ff8d1c25485141b6663114155a9b5d6cf43d1
> SHA1 (patch-aj) = 3b2aa86b3ffe4df3eeb63d2e32350d7551791548
> SHA1 (patch-ak) = 7b9c57f9471ef44838f239a1b4a77848fe135bfc
> SHA1 (patch-al) = 6d38548d7fcadddcb998bb8a33d89703118edbaa
> SHA1 (patch-am) = ce25509b2e1b10bb0587a8d30f66db9030e8e59b
Index: patches/patch-ab
===================================================================
RCS file: patches/patch-ab
diff -N patches/patch-ab
0a1,22
> $NetBSD$
> 
> --- c.c.orig	2004-02-28 16:37:52.000000000 +0100
> +++ c.c
> @@ -612,7 +612,7 @@ static const char *keywordString (const 
>      return name;
>  }
>  
> -static void __unused__ pt (tokenInfo *const token)
> +static void _exctags_unused_ pt (tokenInfo *const token)
>  {
>      if (isType (token, TOKEN_NAME))
>  	printf ("type: %-12s: %-13s   line: %lu\n",
> @@ -627,7 +627,7 @@ static void __unused__ pt (tokenInfo *co
>  	       tokenString (token->type), token->lineNumber);
>  }
>  
> -static void __unused__ ps (statementInfo *const st)
> +static void _exctags_unused_ ps (statementInfo *const st)
>  {
>      unsigned int i;
>      printf ("scope: %s   decl: %s   gotName: %s   gotParenName: %s\n",
Index: patches/patch-ac
===================================================================
RCS file: patches/patch-ac
diff -N patches/patch-ac
0a1,13
> $NetBSD$
> 
> --- debug.h.orig	2002-02-17 07:04:32.000000000 +0100
> +++ debug.h
> @@ -58,7 +58,7 @@ enum eDebugLevels {
>  *   Function prototypes
>  */
>  extern void lineBreak (void);
> -extern void debugPrintf (const enum eDebugLevels level, const char *const format, ...) __printf__ (2, 3);
> +extern void debugPrintf (const enum eDebugLevels level, const char *const format, ...) _exctags_printf_ (2, 3);
>  extern void debugPutc (const int level, const int c);
>  extern void debugParseNest (const boolean increase, const unsigned int level);
>  extern void debugCppNest (const boolean begin, const unsigned int level);
Index: patches/patch-ad
===================================================================
RCS file: patches/patch-ad
diff -N patches/patch-ad
0a1,13
> $NetBSD$
> 
> --- eiffel.c.orig	2003-07-17 05:08:23.000000000 +0200
> +++ eiffel.c
> @@ -767,7 +767,7 @@ static void findKeyword (tokenInfo *cons
>  	readToken (token);
>  }
>  
> -static void parseGeneric (tokenInfo *const token, boolean declaration __unused__)
> +static void parseGeneric (tokenInfo *const token, boolean declaration _exctags_unused_)
>  {
>      unsigned int depth = 0;
>  #ifdef TYPE_REFERENCE_TOOL
Index: patches/patch-ae
===================================================================
RCS file: patches/patch-ae
diff -N patches/patch-ae
0a1,20
> $NetBSD$
> 
> --- general.h.orig	2003-04-01 07:02:13.000000000 +0200
> +++ general.h
> @@ -57,11 +57,11 @@
>   *  to prevent warnings about unused variables.
>   */
>  #if (__GNUC__ > 2  ||  (__GNUC__ == 2  &&  __GNUC_MINOR__ >= 7)) && !(defined (__APPLE_CC__) || defined (__GNUG__))
> -# define __unused__	__attribute__((unused))
> -# define __printf__(s,f)  __attribute__((format (printf, s, f)))
> +# define _exctags_unused_	__attribute__((unused))
> +# define _exctags_printf_(s,f)  __attribute__((format (printf, s, f)))
>  #else
> -# define __unused__
> -# define __printf__(s,f)
> +# define _exctags_unused_
> +# define _exctags_printf_(s,f)
>  #endif
>  
>  /*
Index: patches/patch-af
===================================================================
RCS file: patches/patch-af
diff -N patches/patch-af
0a1,83
> $NetBSD$
> 
> --- lregex.c.orig	2003-07-11 03:21:53.000000000 +0200
> +++ lregex.c
> @@ -530,11 +530,11 @@ extern void findRegexTags (void)
>  #endif /* HAVE_REGEX */
>  
>  extern void addTagRegex (
> -	const langType language __unused__,
> -	const char* const regex __unused__,
> -	const char* const name __unused__,
> -	const char* const kinds __unused__,
> -	const char* const flags __unused__)
> +	const langType language _exctags_unused_,
> +	const char* const regex _exctags_unused_,
> +	const char* const name _exctags_unused_,
> +	const char* const kinds _exctags_unused_,
> +	const char* const flags _exctags_unused_)
>  {
>  #ifdef HAVE_REGEX
>      Assert (regex != NULL);
> @@ -556,10 +556,10 @@ extern void addTagRegex (
>  }
>  
>  extern void addCallbackRegex (
> -	const langType language __unused__,
> -	const char* const regex __unused__,
> -	const char* const flags __unused__,
> -	const regexCallback callback __unused__)
> +	const langType language _exctags_unused_,
> +	const char* const regex _exctags_unused_,
> +	const char* const flags _exctags_unused_,
> +	const regexCallback callback _exctags_unused_)
>  {
>  #ifdef HAVE_REGEX
>      Assert (regex != NULL);
> @@ -573,7 +573,7 @@ extern void addCallbackRegex (
>  }
>  
>  extern void addLanguageRegex (
> -	const langType language __unused__, const char* const regex __unused__)
> +	const langType language _exctags_unused_, const char* const regex _exctags_unused_)
>  {
>  #ifdef HAVE_REGEX
>      if (! regexBroken)
> @@ -594,7 +594,7 @@ extern void addLanguageRegex (
>  */
>  
>  extern boolean processRegexOption (const char *const option,
> -				   const char *const parameter __unused__)
> +				   const char *const parameter _exctags_unused_)
>  {
>      boolean handled = FALSE;
>      const char* const dash = strchr (option, '-');
> @@ -616,7 +616,7 @@ extern boolean processRegexOption (const
>      return handled;
>  }
>  
> -extern void disableRegexKinds (const langType language __unused__)
> +extern void disableRegexKinds (const langType language _exctags_unused_)
>  {
>  #ifdef HAVE_REGEX
>      if (language <= SetUpper  &&  Sets [language].count > 0)
> @@ -631,8 +631,8 @@ extern void disableRegexKinds (const lan
>  }
>  
>  extern boolean enableRegexKind (
> -	const langType language __unused__,
> -	const int kind __unused__, const boolean mode __unused__)
> +	const langType language _exctags_unused_,
> +	const int kind _exctags_unused_, const boolean mode _exctags_unused_)
>  {
>      boolean result = FALSE;
>  #ifdef HAVE_REGEX
> @@ -652,7 +652,7 @@ extern boolean enableRegexKind (
>      return result;
>  }
>  
> -extern void printRegexKinds (const langType language __unused__, boolean indent)
> +extern void printRegexKinds (const langType language _exctags_unused_, boolean indent)
>  {
>  #ifdef HAVE_REGEX
>      if (language <= SetUpper  &&  Sets [language].count > 0)
Index: patches/patch-ag
===================================================================
RCS file: patches/patch-ag
diff -N patches/patch-ag
0a1,13
> $NetBSD$
> 
> --- lua.c.orig	2002-03-01 04:47:29.000000000 +0100
> +++ lua.c
> @@ -37,7 +37,7 @@ static kindOption LuaKinds [] = {
>  */
>  
>  /* for debugging purposes */
> -static void __unused__ print_string (char *p, char *q)
> +static void _exctags_unused_ print_string (char *p, char *q)
>  {
>      for ( ; p != q; p++)
>  	fprintf (errout, "%c", *p);
Index: patches/patch-ah
===================================================================
RCS file: patches/patch-ah
diff -N patches/patch-ah
0a1,13
> $NetBSD$
> 
> --- main.c.orig	2004-03-26 06:07:18.000000000 +0100
> +++ main.c
> @@ -515,7 +515,7 @@ static void makeTags (cookedArgs* args)
>   *	Start up code
>   */
>  
> -extern int main (int __unused__ argc, char **argv)
> +extern int main (int _exctags_unused_ argc, char **argv)
>  {
>      cookedArgs *args;
>  #ifdef VMS
Index: patches/patch-ai
===================================================================
RCS file: patches/patch-ai
diff -N patches/patch-ai
0a1,77
> $NetBSD$
> 
> --- options.c.orig	2004-02-28 16:19:45.000000000 +0100
> +++ options.c
> @@ -725,7 +725,7 @@ static void processEtagsInclude (
>  }
>  
>  static void processExcludeOption (
> -	const char *const option __unused__, const char *const parameter)
> +	const char *const option _exctags_unused_, const char *const parameter)
>  {
>      const char *const fileName = parameter + 1;
>      if (parameter [0] == '\0')
> @@ -860,7 +860,7 @@ static void processFieldsOption (
>  }
>  
>  static void processFilterTerminatorOption (
> -	const char *const option __unused__, const char *const parameter)
> +	const char *const option _exctags_unused_, const char *const parameter)
>  {
>      freeString (&Option.filterTerminator);
>      Option.filterTerminator = stringCopy (parameter);
> @@ -922,8 +922,8 @@ static void printProgramIdentification (
>  }
>  
>  static void processHelpOption (
> -	const char *const option __unused__,
> -	const char *const parameter __unused__)
> +	const char *const option _exctags_unused_,
> +	const char *const parameter _exctags_unused_)
>  {
>      printProgramIdentification ();
>      putchar ('\n');
> @@ -1131,8 +1131,8 @@ static void processLanguagesOption (
>  }
>  
>  static void processLicenseOption (
> -	const char *const option __unused__,
> -	const char *const parameter __unused__)
> +	const char *const option _exctags_unused_,
> +	const char *const parameter _exctags_unused_)
>  {
>      printProgramIdentification ();
>      puts ("");
> @@ -1158,8 +1158,8 @@ static void processListKindsOption (
>  }
>  
>  static void processListMapsOption (
> -	const char *const __unused__ option,
> -	const char *const __unused__ parameter)
> +	const char *const _exctags_unused_ option,
> +	const char *const _exctags_unused_ parameter)
>  {
>      if (parameter [0] == '\0' || strcasecmp (parameter, "all") == 0)
>          printLanguageMaps (LANG_AUTO);
> @@ -1175,8 +1175,8 @@ static void processListMapsOption (
>  }
>  
>  static void processListLanguagesOption (
> -	const char *const option __unused__,
> -	const char *const parameter __unused__)
> +	const char *const option _exctags_unused_,
> +	const char *const parameter _exctags_unused_)
>  {
>      printLanguageList ();
>      exit (0);
> @@ -1350,8 +1350,8 @@ static void processIgnoreOption (const c
>  }
>  
>  static void processVersionOption (
> -	const char *const option __unused__,
> -	const char *const parameter __unused__)
> +	const char *const option _exctags_unused_,
> +	const char *const parameter _exctags_unused_)
>  {
>      printProgramIdentification ();
>      exit (0);
Index: patches/patch-aj
===================================================================
RCS file: patches/patch-aj
diff -N patches/patch-aj
0a1,13
> $NetBSD$
> 
> --- options.h.orig	2003-07-21 03:09:08.000000000 +0200
> +++ options.h
> @@ -121,7 +121,7 @@ extern CONST_OPTION optionValues	Option;
>  /*
>  *   FUNCTION PROTOTYPES
>  */
> -extern void verbose (const char *const format, ...) __printf__ (1, 2);
> +extern void verbose (const char *const format, ...) _exctags_printf_ (1, 2);
>  extern void freeList (stringList** const pString);
>  extern void setDefaultTagFileName (void);
>  extern void checkOptions (void);
Index: patches/patch-ak
===================================================================
RCS file: patches/patch-ak
diff -N patches/patch-ak
0a1,13
> $NetBSD$
> 
> --- parse.c.orig	2003-10-13 04:35:45.000000000 +0200
> +++ parse.c
> @@ -354,7 +354,7 @@ extern void freeParserResources (void)
>  */
>  
>  extern void processLanguageDefineOption (
> -	const char *const option, const char *const parameter __unused__)
> +	const char *const option, const char *const parameter _exctags_unused_)
>  {
>  #ifdef HAVE_REGEX
>      if (parameter [0] == '\0')
Index: patches/patch-al
===================================================================
RCS file: patches/patch-al
diff -N patches/patch-al
0a1,13
> $NetBSD$
> 
> --- routines.c.orig	2003-10-31 05:15:35.000000000 +0100
> +++ routines.c
> @@ -517,7 +517,7 @@ static boolean isPathSeparator (const in
>  
>  #if ! defined (HAVE_STAT_ST_INO)
>  
> -static void canonicalizePath (char *const path __unused__)
> +static void canonicalizePath (char *const path _exctags_unused_)
>  {
>  #if defined (MSDOS_STYLE_PATH)
>      char *p;
Index: patches/patch-am
===================================================================
RCS file: patches/patch-am
diff -N patches/patch-am
0a1,13
> $NetBSD$
> 
> --- routines.h.orig	2003-10-13 04:35:45.000000000 +0200
> +++ routines.h
> @@ -84,7 +84,7 @@ typedef struct {
>  extern void freeRoutineResources (void);
>  extern void setExecutableName (const char *const path);
>  extern const char *getExecutableName (void);
> -extern void error (const errorSelection selection, const char *const format, ...) __printf__ (2, 3);
> +extern void error (const errorSelection selection, const char *const format, ...) _exctags_printf_ (2, 3);
>  
>  /* Memory allocation functions */
>  #ifdef NEED_PROTO_MALLOC

>Unformatted: