sshipway / wanderer

Wanderer text-based boulderdash clone game
GNU General Public License v2.0
8 stars 3 forks source link

error: conflicting types for 'malloc' #1

Closed livibetter closed 8 years ago

livibetter commented 8 years ago

I am sure @sshipway is still aware of this, but I think a formal bug report wouldn't be a bad thing.

% make
cc -O -s   -c -o monsters.o monsters.c
monsters.c: In function 'make_monster':
monsters.c:34:11: error: conflicting types for 'malloc'
     char *malloc();
           ^
In file included from /usr/include/bits/string2.h:1273:0,
                 from /usr/include/string.h:634,
                 from wand_head.h:5,
                 from monsters.c:3:
/usr/include/stdlib.h:466:14: note: previous declaration of 'malloc' was here
 extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
              ^
<builtin>: recipe for target 'monsters.o' failed
make: *** [monsters.o] Error 1

With GCC 4.9.3.


Off-topic rant about GitHub I accidentally clicked on New file when my mind was actually thinking "New issue," guess I only had "new" word in my thought or I am still not awake. GitHub automatically created a fork for me, not like I don't appreciate that, but sometimes, not only fat finger can happen, fat mind also can. A confirmation would be nice, because this wasn't my first time have this annoying friendly feature annoyed me.

sshipway commented 8 years ago

It should be possible to just comment out the offending line; prototyping like this is no longer necessary in modern C compilers.

This branch of code is as it was back in '90 and so I'm not surprised that something which compiled on Solaris in '90 has problems under the latest GCC on Linux.

livibetter commented 8 years ago

Seen it fixed in 4478ccac9fd32638a7f4eb2267b27845c0067c8f, closing.