Bug#442854: hex-a-hop: [m68k] FTBFS: packfile.h:57: error: size of array 'static_assert1' is negative

Jens Seidel jensseidel at users.sf.net
Tue Sep 18 09:45:31 UTC 2007


Hi m68k porters!

Could you please help me resolving a problem on the m68k architecture?
I'm the maintainer of hex-a-hop, a funny SDL game, which was mainly
written for i386. During my attempts to make it big endian clean I also
added a static assert test which aim was to check for proper alignment
of a data structure.

I think my test sizeof(Entry)==8 is wrong as it failed on m68k.
Nevertheless I'm nearly sure that this platform doesn't align a char[1]
array on 64 bit boundaries so the code should work :-)

Some parts of the code need to rewritten to properly support all (or at
least more) architectures. But for now I just want to know whether the
current code works.

Can someone please compile and start the attached C program? It just
collects some basic system properties such as sizeof() and tests the
suspicious code fragment. Please send me the output.

You may also directly test hex-a-hop, except the affected test
sizeof(Entry)==8 (I suggest to comment this line out in
debian/patches/endianess.patch) it should compile and run fine (I hope).

On Mon, Sep 17, 2007 at 03:34:25PM +0200, Jens Seidel wrote:
> On Mon, Sep 17, 2007 at 02:46:32PM +0200, Bas Wijnen wrote:
> > Package: hex-a-hop
> > Version: 0.0.20070315-5
> > Severity: Serious
> > Justification: FTBFS
> > 
> > The package fails to build on m68k, see
> > http://buildd.debian.org/fetch.cgi?&pkg=hex-a-hop&ver=0.0.20070315-5&arch=m68k&stamp=1189827580&file=log
> > 
> > g++ -Wall -W -g -DUSE_GETTEXT -O2 -D_VERSION=\"1.0.0\" -DDATA_DIR=\"/usr/share/games/hex-a-hop\" `sdl-config --cflags`  -c -o hex_puzzzle.o hex_puzzzle.cpp
> > packfile.h:57: error: size of array 'static_assert1' is negative
> > http://lists.alioth.debian.org/mailman/listinfo/pkg-games-devel
> 
> Oops, I explitely added this test and now I wonder whether I should be
> happy that this error was found or not :-)
> 
> I do not have access to a m68k machine. Bas, could you please provide

I mean sizeof(Entry).

> 
> The problem is that hex-a-hop reads a char data stream and interprets it as

Not an array but something as a list. At least it does a type conversion
on a char array which is bad style.

> an array of type Entry. I knew that this could cause trouble so I added the

Jens
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: text/x-c++src
Size: 2086 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-games-devel/attachments/20070918/6d673005/attachment.cc 


More information about the Pkg-games-devel mailing list