info-mtools
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Info-mtools] Compile error with clang 3.4 (error: expected ')')


From: Martin Natano
Subject: [Info-mtools] Compile error with clang 3.4 (error: expected ')')
Date: Sat, 22 Feb 2014 19:45:53 +0100
User-agent: Mutt/1.5.22 (2013-10-16)

Hello,

I've run into following error when compiling mtools 4.0.18 on Bitrig:

...
clang  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/etc\" -DCPU_x86_64 -DVENDOR_unknown 
-DOS_bitrig0_1 -DOS_bitrig
0 -DOS_bitrig -O3 -pipe -Wall -fno-strict-aliasing -I.  
-I/usr/ports/pobj/mtools-4.0.18/mtools-4.0.18
  -c /usr/ports/pobj/mtools-4.0.18/mtools-4.0.18/mainloop.c
/usr/ports/pobj/mtools-4.0.18/mtools-4.0.18/mainloop.c:89:15: error: expected 
')'
int unix_loop(UNUSED(Stream_t *Stream), MainParam_t *mp, char *arg,
              ^
/usr/ports/pobj/mtools-4.0.18/mtools-4.0.18/sysincludes.h:106:47: note: 
expanded from macro 'UNUSED'
#  define UNUSED(x) x __attribute__ ((unused));x
                                              ^
/usr/ports/pobj/mtools-4.0.18/mtools-4.0.18/mainloop.c:89:14: note: to match 
this '('
int unix_loop(UNUSED(Stream_t *Stream), MainParam_t *mp, char *arg,
             ^
/usr/ports/pobj/mtools-4.0.18/mtools-4.0.18/mainloop.c:89:41: error: 
redefinition of 'MainParam_t' as
      different kind of symbol
...

The error seems to stem from an apparent misuse of the UNUSED macro
which seems not to be inteded to be used in a function's argument list.

#  define UNUSED(x) x __attribute__ ((unused));x
#  define UNUSEDP __attribute__ ((unused))

The correct fix would probably be to replace UNUSED with UNUSEDP in the
argument list. The patch below does just and fixes the build for me.


--- mainloop.c.orig     Sat Feb 22 19:19:53 2014
+++ mainloop.c  Sat Feb 22 19:20:36 2014
@@ -86,7 +86,7 @@ static const char *fix_mcwd(char *ans)
 }
 
 int unix_dir_loop(Stream_t *Stream, MainParam_t *mp); 
-int unix_loop(UNUSED(Stream_t *Stream), MainParam_t *mp, char *arg,
+int unix_loop(Stream_t *Stream UNUSEDP, MainParam_t *mp, char *arg,
              int follow_dir_link);
 
 static int _unix_loop(Stream_t *Dir, MainParam_t *mp,
@@ -95,7 +95,7 @@ static int _unix_loop(Stream_t *Dir, MainParam_t *mp,
        return unix_dir_loop(Dir, mp);
 }
 
-int unix_loop(UNUSED(Stream_t *Stream), MainParam_t *mp,
+int unix_loop(Stream_t *Stream UNUSEDP, MainParam_t *mp,
              char *arg, int follow_dir_link)
 {
        int ret;


cheers,
natano



reply via email to

[Prev in Thread] Current Thread [Next in Thread]