Opened 8 years ago

Closed 8 years ago

#36776 closed defect (fixed)

simutrans: variable length array of non-POD element type 'ware_t'

Reported by: hal_1984@… Owned by: ryandesign (Ryan Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: clang Cc:
Port: simutrans

Description (last modified by mf2k (Frank Schima))

clang: warning: clang: argument unused during compilation: '-L/opt/local/lib'
warning: argument unused during compilation: '-L/opt/local/lib'
freight_list_sorter.cc:114:2: error: variable length array of non-POD element type 'ware_t'
        ALLOCA(ware_t, wlist, warray.get_count());
        ^
./simtypes.h:23:45: note: expanded from macro 'ALLOCA'
#       define ALLOCA(type, name, count) type name[count]
                                                  ^
1 error generated.
make: *** [build/default/freight_list_sorter.o] Error 1

Change History (5)

comment:1 Changed 8 years ago by hal_1984@…

Cc: hal_1984@… added

Cc Me!

comment:2 Changed 8 years ago by mf2k (Frank Schima)

Cc: hal_1984@… removed
Description: modified (diff)

In the future, please use WikiFormatting.

Please attach the complete main.log.

comment:3 Changed 8 years ago by ryandesign (Ryan Schmidt)

Keywords: clang added
Owner: changed from macports-tickets@… to ryandesign@…
Status: newassigned
Summary: simutrans @111.2.2 Build Failedsimutrans: variable length array of non-POD element type 'ware_t'

comment:4 Changed 8 years ago by ryandesign (Ryan Schmidt)

simutrans' incompatibility with clang is discussed in their forum. There's a patch there which goes like this:

--- simutrans-original/simtypes.h	2012-09-09 13:35:26.000000000 +0700
+++ simutrans-patched/simtypes.h	2012-09-12 19:40:08.604767906 +0700
@@ -17,6 +17,9 @@
 #	define ALLOCA(type, name, count) type* name = static_cast<type*>(alloca(sizeof(type) * (count)))
 #
 # define inline _inline
+#elif defined __clang__
+#	include <alloca.h>
+#	define ALLOCA(type, name, count) type* name = static_cast<type*>(alloca(sizeof(type) * (count)))
 #else
 #	define ALLOCA(type, name, count) type name[count]
 #endif

comment:5 Changed 8 years ago by ryandesign (Ryan Schmidt)

Resolution: fixed
Status: assignedclosed

Updated the port and applied this patch in r99164.

Note: See TracTickets for help on using tickets.