Opened 2 months ago

Last modified 2 months ago

#70743 new defect

py27-distorm build error: error: ‘for’ loop initial declaration used outside C99 mode

Reported by: barracuda156 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.10.1
Keywords: Cc: kurthindenburg (Kurt Hindenburg)
Port: py-distorm, py27-distorm

Description

--->  Building py27-distorm
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-distorm/py27-distorm/work/distorm-3.5" && /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build 
running build
running build_py
creating build
creating build/lib.macosx-10.6-ppc-2.7
creating build/lib.macosx-10.6-ppc-2.7/distorm3
copying python/distorm3/__init__.py -> build/lib.macosx-10.6-ppc-2.7/distorm3
copying python/distorm3/__main__.py -> build/lib.macosx-10.6-ppc-2.7/distorm3
copying python/distorm3/_generated.py -> build/lib.macosx-10.6-ppc-2.7/distorm3
running build_ext
building '_distorm3' extension
creating build/temp.macosx-10.6-ppc-2.7
creating build/temp.macosx-10.6-ppc-2.7/src
creating build/temp.macosx-10.6-ppc-2.7/python
/usr/bin/gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -pipe -I/opt/local/libexec/openssl11/include -Os -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch ppc -isysroot/ -DSUPPORT_64BIT_OFFSET -DDISTORM_DYNAMIC -Isrc -Iinclude -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/decoder.c -o build/temp.macosx-10.6-ppc-2.7/src/decoder.o
src/config.h:144: warning: ‘RSHORT’ defined but not used
src/config.h:148: warning: ‘RUSHORT’ defined but not used
src/config.h:152: warning: ‘RLONG’ defined but not used
src/config.h:156: warning: ‘RULONG’ defined but not used
src/config.h:160: warning: ‘RLLONG’ defined but not used
src/config.h:164: warning: ‘RULLONG’ defined but not used
/usr/bin/gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -pipe -I/opt/local/libexec/openssl11/include -Os -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch ppc -isysroot/ -DSUPPORT_64BIT_OFFSET -DDISTORM_DYNAMIC -Isrc -Iinclude -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/distorm.c -o build/temp.macosx-10.6-ppc-2.7/src/distorm.o
src/distorm.c: In function ‘distorm_format64’:
src/distorm.c:187: error: ‘for’ loop initial declaration used outside C99 mode
src/distorm.c: In function ‘distorm_decode64’:
src/distorm.c:393: error: ‘for’ loop initial declaration used outside C99 mode
error: command '/usr/bin/gcc-4.2' failed with exit status 1
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-distorm/py27-distorm/work/distorm-3.5" && /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build 
Exit code: 1
Error: Failed to build py27-distorm: command execution failed

Change History (1)

comment:1 Changed 2 months ago by barracuda156

With gcc14 fails differently:

src/textdefs.c: In function 'str_hex':
src/textdefs.c:45:43: warning: pointer targets in passing argument 1 of 'RSHORT' differ in signedness [-Wpointer-sign]
   45 |                 RSHORT(&s->p[i]) = RSHORT(&TextBTable[(*buf) * 2]);
      |                                           ^~~~~~~~~~~~~~~~~~~~~~~
      |                                           |
      |                                           char *
In file included from src/textdefs.h:15,
                 from src/textdefs.c:12:
src/config.h:143:45: note: expected 'const uint8_t *' {aka 'const unsigned char *'} but argument is of type 'char *'
  143 | STATIC_INLINE int16_t RSHORT(const uint8_t *s)
      |                              ~~~~~~~~~~~~~~~^
src/textdefs.c:45:34: error: lvalue required as left operand of assignment
   45 |                 RSHORT(&s->p[i]) = RSHORT(&TextBTable[(*buf) * 2]);
      |                                  ^

Note: See TracTickets for help on using tickets.