Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7209 closed defect (fixed)

Build error with clang5 on Mac

Reported by: ponpon Owned by:
Priority: important Component: avformat
Version: git-master Keywords: mxf osx regression
Cc: michel.gutierrez@gmail.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

A build error appears since commit 293a6e83325a7379c13469193492fa4cb2488785

CC	libavformat/mp3enc.o
CC	libavformat/mpc.o
CC	libavformat/mpc8.o
CC	libavformat/mpeg.o
CC	libavformat/mpegenc.o
CC	libavformat/mpegts.o
CC	libavformat/mpegtsenc.o
CC	libavformat/mpegvideodec.o
CC	libavformat/mpjpeg.o
CC	libavformat/mpjpegdec.o
CC	libavformat/mpl2dec.o
CC	libavformat/mpsubdec.o
CC	libavformat/msf.o
CC	libavformat/msnwc_tcp.o
CC	libavformat/mtaf.o
CC	libavformat/mtv.o
CC	libavformat/musx.o
CC	libavformat/mux.o
CC	libavformat/mvdec.o
CC	libavformat/mvi.o
CC	libavformat/mxf.o
CC	libavformat/mxfdec.o
CC	libavformat/mxfenc.o
CC	libavformat/mxg.o
CC	libavformat/ncdec.o
libavformat/mxfenc.c:1145:36: error: too many arguments provided to function-like macro invocation
        memcpy(ul, (UID){0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x01,0x01,0x01,0x...
                                   ^
/usr/include/secure/_string.h:64:9: note: macro 'memcpy' defined here
#define memcpy(dest, src, len)                                  \
        ^
libavformat/mxfenc.c:1145:9: note: parentheses are required around macro argument containing braced
      initializer list
  ...memcpy(ul, (UID){0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x01,0x01,0x01,0x01,0x00,0x00},...
     ^
                (                                                                                     )
libavformat/mxfenc.c:1149:36: error: too many arguments provided to function-like macro invocation
        memcpy(ul, (UID){0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x01,0x01,0x01,0x...
                                   ^
/usr/include/secure/_string.h:64:9: note: macro 'memcpy' defined here
#define memcpy(dest, src, len)                                  \
        ^
libavformat/mxfenc.c:1149:9: note: parentheses are required around macro argument containing braced
      initializer list
  ...memcpy(ul, (UID){0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x01,0x01,0x01,0x02,0x00,0x00},...
     ^
                (                                                                                     )
libavformat/mxfenc.c:1152:36: error: too many arguments provided to function-like macro invocation
        memcpy(ul, (UID){0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x01,0x01,0x01,0x...
                                   ^
/usr/include/secure/_string.h:64:9: note: macro 'memcpy' defined here
#define memcpy(dest, src, len)                                  \
        ^
libavformat/mxfenc.c:1152:9: note: parentheses are required around macro argument containing braced
      initializer list
  ...memcpy(ul, (UID){0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x01,0x01,0x01,0x03,0x00,0x00},...
     ^
                (                                                                                     )
libavformat/mxfenc.c:1155:36: error: too many arguments provided to function-like macro invocation
        memcpy(ul, (UID){0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x06,0x04,0x01,0x01,0x01,0x01,0x...
                                   ^
/usr/include/secure/_string.h:64:9: note: macro 'memcpy' defined here
#define memcpy(dest, src, len)                                  \
        ^
libavformat/mxfenc.c:1155:9: note: parentheses are required around macro argument containing braced
      initializer list
  ...memcpy(ul, (UID){0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x06,0x04,0x01,0x01,0x01,0x01,0x05,0x00,0x00},...
     ^
                (                                                                                     )
libavformat/mxfenc.c:1158:36: error: too many arguments provided to function-like macro invocation
        memcpy(ul, (UID){0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x06,0x04,0x01,0x01,0x01,0x01,0x...
                                   ^
/usr/include/secure/_string.h:64:9: note: macro 'memcpy' defined here
#define memcpy(dest, src, len)                                  \
        ^
libavformat/mxfenc.c:1158:9: note: parentheses are required around macro argument containing braced
      initializer list
  ...memcpy(ul, (UID){0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x06,0x04,0x01,0x01,0x01,0x01,0x06,0x00,0x00},...
     ^
                (                                                                                     )
libavformat/mxfenc.c:1161:36: error: too many arguments provided to function-like macro invocation
        memcpy(ul, (UID){0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x08,0x04,0x01,0x01,0x01,0x01,0x...
                                   ^
/usr/include/secure/_string.h:64:9: note: macro 'memcpy' defined here
#define memcpy(dest, src, len)                                  \
        ^
libavformat/mxfenc.c:1161:9: note: parentheses are required around macro argument containing braced
      initializer list
  ...memcpy(ul, (UID){0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x08,0x04,0x01,0x01,0x01,0x01,0x07,0x00,0x00},...
     ^
                (                                                                                     )
6 errors generated.
make: *** [libavformat/mxfenc.o] Error 1
make: *** Waiting for unfinished jobs....
1 warning generated.
1 warning generated.

Change History (6)

comment:1 by Carl Eugen Hoyos, 6 years ago

Component: undeterminedavformat
Keywords: mxfenc osx regression added
Priority: normalimportant
Version: unspecifiedgit-master

comment:2 by Jim DeLaHunt, 6 years ago

On my Mac OS X 10.11.6 system, putting parentheses around the expression (UID){...} on the six affected lines (1152, 1156, 1159, 1162, 1165, 1168) corrected the errors, and let libavformat/mxfenc.o compile cleanly.

I have a branch with this change, which I'm testing. I will make a patch if no-one else does so first.

comment:3 by Jim DeLaHunt, 6 years ago

Patch submitted by Michael Niedermayer, 22. May 2018. See mail to ffmpeg-devel list, [FFmpeg-devel] [PATCH] libavformat/mxfenc: Add some () to attempt to workaround build issue on osx (http://ffmpeg.org/pipermail/ffmpeg-devel/2018-May/230408.html)

comment:4 by mig, 6 years ago

Cc: michel.gutierrez@gmail.com added

comment:5 by Carl Eugen Hoyos, 6 years ago

Resolution: fixed
Status: newclosed

comment:6 by Carl Eugen Hoyos, 6 years ago

Keywords: mxf added; mxfenc removed
Note: See TracTickets for help on using tickets.