Opened 5 months ago

Closed 4 weeks ago

#70170 closed defect (fixed)

ctpv @1.1: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’

Reported by: barracuda156 Owned by: suhailskhan (Suhail Khan)
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: Cc:
Port: ctpv

Description

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/usr/bin/gcc-4.2 -o src/ulist.o src/ulist.c -c -O2 -MMD -Wall -Wextra -Wno-unused-parameter -Os -arch ppc -I/opt/local/include
In file included from src/preview.h:6,
                 from src/config.h:4,
                 from src/config.c:6:
src/vector.h:84: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/vector.h:84: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/vector.h:84: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/vector.h:84: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/vector.h:84: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/vector.h:84: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
In file included from src/config.h:4,
                 from src/config.c:6:
src/preview.h:21: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/preview.h:21: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/preview.h:21: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/preview.h:21: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/preview.h:21: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/preview.h:21: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/config.c: In function ‘add_preview’:
src/config.c:85: error: ‘for’ loop initial declaration used outside C99 mode
src/config.c:101: warning: implicit declaration of function ‘vectorPreview_append’
src/config.c: In function ‘add_priority’:
src/config.c:112: error: ‘for’ loop initial declaration used outside C99 mode
src/config.c: In function ‘remove_preview’:
src/config.c:130: error: ‘for’ loop initial declaration used outside C99 mode
src/config.c:134: warning: implicit declaration of function ‘vectorPreview_remove’
src/config.c: In function ‘expect’:
src/config.c:164: error: expected ‘)’ before ‘__VA_OPT__’
src/config.c: In function ‘get_option’:
src/config.c:231: error: ‘for’ loop initial declaration used outside C99 mode
src/config.c: In function ‘cmd_set’:
src/config.c:246: error: expected ‘)’ before ‘__VA_OPT__’
src/config.c:265: warning: implicit declaration of function ‘print_int_error__VA_OPT__’
src/config.c:265: error: ‘f’ undeclared (first use in this function)
src/config.c:265: error: (Each undeclared identifier is reported only once
src/config.c:265: error: for each function it appears in.)
src/config.c:265: error: expected ‘)’ before ‘__VA_OPT__’
src/config.c:265: error: called object ‘print_int_error__VA_OPT__(<erroneous-expression>)’ is not a function
src/config.c: In function ‘cmd_preview’:
src/config.c:282: error: expected ‘)’ before ‘__VA_OPT__’
src/config.c: In function ‘cmd_priority’:
src/config.c:308: error: expected ‘)’ before ‘__VA_OPT__’
src/config.c: In function ‘cmd_remove’:
src/config.c:321: error: expected ‘)’ before ‘__VA_OPT__’
src/config.c: In function ‘command’:
src/config.c:342: error: expected ‘)’ before ‘__VA_OPT__’
src/config.c: In function ‘config_load’:
src/config.c:410: warning: implicit declaration of function ‘__VA_OPT__’
src/config.c:410: error: expected expression before ‘do’
src/config.c:410: error: expected ‘;’ before ‘ret’
src/config.c:413: error: expected ‘)’ before ‘__VA_OPT__’
src/config.c:413: error: called object ‘print_int_error__VA_OPT__(f)’ is not a function
src/config.c:420: error: expected expression before ‘do’
src/config.c:420: error: expected ‘;’ before ‘ret’
src/config.c:422: error: expected expression before ‘do’
src/config.c:422: error: expected ‘;’ before ‘ret’
make: *** [src/config.o] Error 1
make: *** Waiting for unfinished jobs....
embed.c: In function ‘main’:
embed.c:91: error: ‘for’ loop initial declaration used outside C99 mode
make[1]: *** [embed] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/ctpv-1.1/embed'
make: *** [embed/embed] Error 2
src/ulist.c: In function ‘ulist_node_new’:
src/ulist.c:38: warning: implicit declaration of function ‘print_int_error__VA_OPT__’
src/ulist.c:38: error: ‘f’ undeclared (first use in this function)
src/ulist.c:38: error: (Each undeclared identifier is reported only once
src/ulist.c:38: error: for each function it appears in.)
src/ulist.c:38: error: expected ‘)’ before ‘__VA_OPT__’
src/ulist.c:38: error: called object ‘print_int_error__VA_OPT__(<erroneous-expression>)’ is not a function
src/ulist.c: In function ‘ulist_new’:
src/ulist.c:54: error: ‘f’ undeclared (first use in this function)
src/ulist.c:54: error: expected ‘)’ before ‘__VA_OPT__’
src/ulist.c:54: error: called object ‘print_int_error__VA_OPT__(<erroneous-expression>)’ is not a function
src/lexer.c: In function ‘peekn_char’:
src/lexer.c:90: warning: implicit declaration of function ‘print_int_error__VA_OPT__’
src/lexer.c:90: error: ‘f’ undeclared (first use in this function)
src/lexer.c:90: error: (Each undeclared identifier is reported only once
src/lexer.c:90: error: for each function it appears in.)
src/lexer.c:90: error: expected ‘)’ before ‘__VA_OPT__’
src/lexer.c:90: error: called object ‘print_int_error__VA_OPT__(<erroneous-expression>)’ is not a function
src/lexer.c: In function ‘skipn_char’:
src/lexer.c:128: error: ‘for’ loop initial declaration used outside C99 mode
src/lexer.c: In function ‘lexer_init’:
src/lexer.c:152: error: expected ‘)’ before ‘__VA_OPT__’
src/lexer.c:152: error: called object ‘print_int_error__VA_OPT__(f)’ is not a function
make: *** [src/ulist.o] Error 1
src/lexer.c: In function ‘read_block’:
src/lexer.c:361: error: expected ‘)’ before ‘__VA_OPT__’
src/lexer.c: In function ‘lexer_get_token’:
src/lexer.c:424: error: expected ‘)’ before ‘__VA_OPT__’
src/lexer.c: In function ‘lexer_token_type_str’:
src/lexer.c:455: error: ‘f’ undeclared (first use in this function)
src/lexer.c:455: error: expected ‘)’ before ‘__VA_OPT__’
src/lexer.c:455: error: called object ‘print_int_error__VA_OPT__(<erroneous-expression>)’ is not a function
In file included from src/preview.h:6,
                 from src/preview.c:9:
src/vector.h:84: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/vector.h:84: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/vector.h:84: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/vector.h:84: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/vector.h:84: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/vector.h:84: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
In file included from src/preview.c:9:
src/preview.h:21: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/preview.h:21: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/preview.h:21: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/preview.h:21: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/preview.h:21: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/preview.h:21: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/preview.c:18: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/preview.c:18: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/preview.c:18: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/preview.c:18: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/preview.c:18: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/preview.c:18: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
src/preview.c: In function ‘previews_init’:
src/preview.c:56: warning: implicit declaration of function ‘print_int_error__VA_OPT__’
src/preview.c:56: error: ‘f’ undeclared (first use in this function)
src/preview.c:56: error: (Each undeclared identifier is reported only once
src/preview.c:56: error: for each function it appears in.)
src/preview.c:56: error: expected ‘)’ before ‘__VA_OPT__’
src/preview.c:56: error: called object ‘print_int_error__VA_OPT__(<erroneous-expression>)’ is not a function
src/preview.c:60: error: ‘for’ loop initial declaration used outside C99 mode
make: *** [src/lexer.o] Error 1
src/preview.c: In function ‘break_mimetype’:
src/preview.c:83: error: ‘f’ undeclared (first use in this function)
src/preview.c:83: error: expected ‘)’ before ‘__VA_OPT__’
src/preview.c:83: error: called object ‘print_int_error__VA_OPT__(<erroneous-expression>)’ is not a function
src/preview.c: In function ‘check_init_previews’:
src/preview.c:125: error: ‘f’ undeclared (first use in this function)
src/preview.c:125: error: expected ‘)’ before ‘__VA_OPT__’
src/preview.c:125: error: called object ‘print_int_error__VA_OPT__(<erroneous-expression>)’ is not a function
src/preview.c: In function ‘run’:
src/preview.c:133: warning: implicit declaration of function ‘__VA_OPT__’
src/preview.c:133: error: expected expression before ‘do’
src/preview.c:133: error: expected ‘;’ before ‘return’
src/preview.c:149: error: ‘f’ undeclared (first use in this function)
src/preview.c:149: error: expected ‘)’ before ‘__VA_OPT__’
src/preview.c:149: error: called object ‘print_int_error__VA_OPT__(<erroneous-expression>)’ is not a function
src/preview.c: In function ‘preview_run’:
src/preview.c:168: error: expected expression before ‘do’
src/preview.c:168: error: expected ‘;’ before ‘return’
src/preview.c:170: error: expected expression before ‘do’
src/preview.c:170: error: expected ‘;’ before ‘return’
src/preview.c:171: error: expected expression before ‘do’
src/preview.c:171: error: expected ‘;’ before ‘return’
src/preview.c:172: error: expected expression before ‘do’
src/preview.c:172: error: expected ‘;’ before ‘return’
src/preview.c:173: error: expected expression before ‘do’
src/preview.c:173: error: expected ‘;’ before ‘return’
src/preview.c:174: error: expected expression before ‘do’
src/preview.c:174: error: expected ‘;’ before ‘return’
src/preview.c:175: error: expected expression before ‘do’
src/preview.c:175: error: expected ‘;’ before ‘return’
src/preview.c:176: error: expected expression before ‘do’
src/preview.c:176: error: expected ‘;’ before ‘return’
src/preview.c:177: error: expected expression before ‘do’
src/preview.c:177: error: expected ‘;’ before ‘return’
src/preview.c:181: error: expected expression before ‘do’
src/preview.c:181: error: expected ‘;’ before ‘return’
src/preview.c:184: error: expected expression before ‘do’
src/preview.c:184: error: expected ‘;’ before ‘return’
src/preview.c:185: error: expected expression before ‘do’
src/preview.c:185: error: expected ‘;’ before ‘return’
src/preview.c:204: error: expected expression before ‘do’
src/preview.c:204: error: expected ‘;’ before ‘return’
make: *** [src/preview.o] Error 1
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/ctpv-1.1'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/ctpv-1.1" && /usr/bin/make -j6 -w all CC="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/usr/bin/gcc-4.2" CXX="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cxx/usr/bin/g++-4.2" OBJC="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/objc/usr/bin/gcc-4.2" OBJCXX="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/objcxx/usr/bin/g++-4.2" INSTALL="/usr/bin/install -c" 
Exit code: 2

Attachments (1)

main.log (47.5 KB) - added by barracuda156 5 months ago.

Download all attachments as: .zip

Change History (15)

Changed 5 months ago by barracuda156

Attachment: main.log added

comment:1 Changed 5 months ago by suhailskhan (Suhail Khan)

OS and CPU architecture of the system this occurred on?

comment:2 Changed 5 months ago by jmroot (Joshua Root)

It's in the log.

:debug:sysinfo Mac OS X 10.6 (darwin/10.0.0d2) arch powerpc

PPC system running a developer preview that is somewhere between 10.5 and 10.6.

comment:3 Changed 5 months ago by jmroot (Joshua Root)

Probably would affect more conventional systems using compilers that default to C89 as well. Likely just needs an explicit -std=c99 or whatever in the flags.

comment:4 Changed 5 months ago by jmroot (Joshua Root)

Hm, actually it may need to ensure that the compiler used understands the __VA_OPT__ usage too.

comment:5 Changed 7 weeks ago by suhailskhan (Suhail Khan)

Resolved as of commit 2d656f8. Thanks to barracuda156 for determining the solution.

The cause of this issue is that Xcode 3.1 and 3.2, the recommended Xcode releases for use with MacPorts on 10.5 and 10.6, respectively, include GCC 4.x, which fails to build the port. We are now blacklisting GCC 4.x.

Last edited 7 weeks ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:6 Changed 7 weeks ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed
Summary: ctpv fails to build: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’ctpv @1.1: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’

Blacklisting old compilers is not necessarily the solution we want. For example, if the only problem is that this code needs C99, then gcc 4.2 supports C99 and should simply be instructed to use it via the -std=c99 or -std=gnu99 flag. However, if there are additional issues such that gcc 4.2 really cannot compile this code regardless what language standard it's using, then blacklisting it is of course correct.

Don't forget in the future to include in your commit message that it resolves a ticket so that the ticket can auto-close.

comment:7 Changed 7 weeks ago by jmroot (Joshua Root)

I notice the build still failed on 10.6 after that commit.

comment:8 in reply to:  7 Changed 7 weeks ago by barracuda156

Replying to jmroot:

I notice the build still failed on 10.6 after that commit.

On 10.6 x86 MacPorts does not use gcc-4.2, so my fix is obviously inconsequential there, it changes nothing in existing behavior. It should fix the build on 10.5, but no buildbots for it.

Last edited 7 weeks ago by barracuda156 (previous) (diff)

comment:9 in reply to:  7 Changed 7 weeks ago by barracuda156

Replying to jmroot:

I notice the build still failed on 10.6 after that commit.

Builds fine with clang-16:

10:~ svacchanda$ sudo port -v -n build ctpv -universal configure.compiler=macports-clang-16
--->  Computing dependencies for ctpv.
--->  Fetching distfiles for ctpv
--->  Verifying checksums for ctpv
--->  Checksumming ctpv-1.1.tar.gz
--->  Extracting ctpv
--->  Extracting ctpv-1.1.tar.gz
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/ctpv/ctpv-1.1.tar.gz' | /usr/bin/gnutar --no-same-owner -xf - 
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/opt
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/opt/local
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/opt/local/bin
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/objc
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/objc/opt
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/objc/opt/local
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/objc/opt/local/bin
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cxx
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cxx/opt
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cxx/opt/local
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cxx/opt/local/bin
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/objcxx
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/objcxx/opt
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/objcxx/opt/local
xinstall: mkdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/objcxx/opt/local/bin
--->  Configuring ctpv
--->  Building ctpv
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/ctpv-1.1" && /usr/bin/make -j6 -w all CC="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/opt/local/bin/clang-mp-16" CXX="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cxx/opt/local/bin/clang++-mp-16" OBJC="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/objc/opt/local/bin/clang-mp-16" OBJCXX="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/objcxx/opt/local/bin/clang++-mp-16" INSTALL="/usr/bin/install -c" 
make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/ctpv-1.1'
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/opt/local/bin/clang-mp-16 -o src/config.o src/config.c -c -O2 -MMD -Wall -Wextra -Wno-unused-parameter -Os -arch x86_64 -I/opt/local/include
/usr/bin/make -C embed
mkdir -p gen
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/opt/local/bin/clang-mp-16 -o src/error.o src/error.c -c -O2 -MMD -Wall -Wextra -Wno-unused-parameter -Os -arch x86_64 -I/opt/local/include
make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/ctpv-1.1/embed'
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/opt/local/bin/clang-mp-16 -Os -arch x86_64 -I/opt/local/include -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64  embed.c   -o embed
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/opt/local/bin/clang-mp-16 -o src/lexer.o src/lexer.c -c -O2 -MMD -Wall -Wextra -Wno-unused-parameter -Os -arch x86_64 -I/opt/local/include
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/opt/local/bin/clang-mp-16 -o src/preview.o src/preview.c -c -O2 -MMD -Wall -Wextra -Wno-unused-parameter -Os -arch x86_64 -I/opt/local/include
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/opt/local/bin/clang-mp-16 -o src/ulist.o src/ulist.c -c -O2 -MMD -Wall -Wextra -Wno-unused-parameter -Os -arch x86_64 -I/opt/local/include
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/opt/local/bin/clang-mp-16 -o src/utils.o src/utils.c -c -O2 -MMD -Wall -Wextra -Wno-unused-parameter -Os -arch x86_64 -I/opt/local/include
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/opt/local/bin/clang-mp-16 -o src/vector.o src/vector.c -c -O2 -MMD -Wall -Wextra -Wno-unused-parameter -Os -arch x86_64 -I/opt/local/include
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/ctpv-1.1/embed'
embed/embed -p prev_scr_ sh/prev/any.sh sh/prev/atool.sh sh/prev/audio.sh sh/prev/bat.sh sh/prev/cat.sh sh/prev/colordiff.sh sh/prev/delta.sh sh/prev/diff_so_fancy.sh sh/prev/elinks.sh sh/prev/font.sh sh/prev/glow.sh sh/prev/gpg.sh sh/prev/highlight.sh sh/prev/image.sh sh/prev/jq.sh sh/prev/libreoffice.sh sh/prev/ls.sh sh/prev/lynx.sh sh/prev/mdcat.sh sh/prev/pdf.sh sh/prev/source_highlight.sh sh/prev/svg.sh sh/prev/symlink.sh sh/prev/torrent.sh sh/prev/video.sh sh/prev/w3m.sh > gen/previews.h
embed/embed help.txt > gen/help.h
embed/embed -p scr_ sh/clear.sh sh/end.sh > gen/server.h
embed/embed -p scr_ sh/helpers.sh > gen/helpers.h
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/opt/local/bin/clang-mp-16 -o src/ctpv.o src/ctpv.c -c -O2 -MMD -Wall -Wextra -Wno-unused-parameter -Os -arch x86_64 -I/opt/local/include
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/opt/local/bin/clang-mp-16 -o src/server.o src/server.c -c -O2 -MMD -Wall -Wextra -Wno-unused-parameter -Os -arch x86_64 -I/opt/local/include
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/opt/local/bin/clang-mp-16 -o src/shell.o src/shell.c -c -O2 -MMD -Wall -Wextra -Wno-unused-parameter -Os -arch x86_64 -I/opt/local/include
src/ctpv.c:175:5: warning: 'MD5' is deprecated [-Wdeprecated-declarations]
    MD5((const unsigned char *)s, strlen(s), out);
    ^
/opt/local/include/openssl/md5.h:52:1: note: 'MD5' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 unsigned char *MD5(const unsigned char *d, size_t n,
^
/opt/local/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/opt/local/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
1 warning generated.
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/compwrap/cc/opt/local/bin/clang-mp-16 -o ctpv src/config.o src/ctpv.o src/error.o src/lexer.o src/preview.o src/server.o src/shell.o src/ulist.o src/utils.o src/vector.o -lmagic -lcrypto -Os -arch x86_64 -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_ctpv/ctpv/work/ctpv-1.1'
10:~ svacchanda$ port -v installed ctpv
The following ports are currently installed:
  ctpv @1.1_0 (active) requested_variants='-universal' platform='darwin 10' archs='x86_64' date='2024-09-28T02:57:58+0800'

comment:10 Changed 5 weeks ago by suhailskhan (Suhail Khan)

Resolution: fixed
Status: closedreopened

Blacklisting old compilers is not necessarily the solution we want. For example, if the only problem is that this code needs C99, then gcc 4.2 supports C99 and should simply be instructed to use it via the -std=c99 or -std=gnu99 flag.

After looking more into this, I found that __VA_OPT__ is a C23/C++20 feature.

Replacing the compiler.blacklist-append line with compiler.cxx_standard 2020 may be the correct solution. It fixes the build when I tested it on Snow Leopard, and hopefully should for Leopard and preview builds of Snow Leopard as well. I tried using compiler.c_standard 2023 as well, but the build failed.

comment:11 in reply to:  10 ; Changed 5 weeks ago by barracuda156

Replying to suhailskhan:

Blacklisting old compilers is not necessarily the solution we want. For example, if the only problem is that this code needs C99, then gcc 4.2 supports C99 and should simply be instructed to use it via the -std=c99 or -std=gnu99 flag.

After looking more into this, I found that __VA_OPT__ is a C23/C++20 feature.

Replacing the compiler.blacklist-append line with compiler.cxx_standard 2020 may be the correct solution. It fixes the build when I tested it on Snow Leopard, and hopefully should for Leopard and preview builds of Snow Leopard as well. I tried using compiler.c_standard 2023 as well, but the build failed.

If it uses modern C++ specifically, then portfile must have compiler.cxx_standard, blacklist won’t work correctly (since C++ standard does more than compiler choice).

Last edited 5 weeks ago by barracuda156 (previous) (diff)

comment:12 in reply to:  11 Changed 5 weeks ago by suhailskhan (Suhail Khan)

Replying to barracuda156:

Replying to suhailskhan:

Blacklisting old compilers is not necessarily the solution we want. For example, if the only problem is that this code needs C99, then gcc 4.2 supports C99 and should simply be instructed to use it via the -std=c99 or -std=gnu99 flag.

After looking more into this, I found that __VA_OPT__ is a C23/C++20 feature.

Replacing the compiler.blacklist-append line with compiler.cxx_standard 2020 may be the correct solution. It fixes the build when I tested it on Snow Leopard, and hopefully should for Leopard and preview builds of Snow Leopard as well. I tried using compiler.c_standard 2023 as well, but the build failed.

If it uses modern C++ specifically, then portfile must have compiler.cxx_standard, blacklist won’t work correctly (since C++ standard does more than compiler choice).

I initially took the blacklist approach because I noticed the build would fail on Big Sur, whose final Xcode release was 13.2.1. For systems with Xcode 14 and above, Xcode’s clang was able to build the port successfully. At the time, I was not concerned with the actual root cause, but figured blacklisting clang with build numbers below 1400 (i.e. builds shipped with Xcode prior to Xcode 14) would be a sufficient solution.

This successfully resolved the build issue for Big Sur, as well as prior releases all the way down to Lion. I did notice it would still fail for Leopard and Snow Leopard.

Anyway, pending merge of PR #26139, we will now stop using the blacklist and start defining the required language standard.

comment:13 in reply to:  11 Changed 5 weeks ago by suhailskhan (Suhail Khan)

Replying to barracuda156:

If it uses modern C++ specifically, then portfile must have compiler.cxx_standard, blacklist won’t work correctly (since C++ standard does more than compiler choice).

For what it’s worth, ctpv is a pure C-based project, but __VA_OPT__ happens to be a C++20 feature as well as a C23 one. This is why compiler.cxx_standard 2020 is valid despite the source code not having any C++. It still achieves the desired end result of ensuring only compilers that support __VA_OPT__ are used.

It appears that MacPorts currently does not recognize compiler.c_standard 2023 yet because C23 is still very recent, so using that in the Portfile will make it fall back to compiler.c_standard 2017 instead, if I am not mistaken. Otherwise, we would ideally use that in the Portfile instead.

Last edited 5 weeks ago by suhailskhan (Suhail Khan) (previous) (diff)

comment:14 Changed 4 weeks ago by Suhail Khan <26044674+suhailskhan@…>

Resolution: fixed
Status: reopenedclosed

In 78beb8e464fded749675a596ae303323e2bcb775/macports-ports (master):

ctpv: fix build on Leopard and Snow Leopard

Closes: #70170

Note: See TracTickets for help on using tickets.