GCC 4.3

Strictly for discussing ZSNES development and for submitting code. You can also join us on IRC at irc.libera.chat in #zsnes.
Please, no requests here.

Moderator: ZSNES Mods

Post Reply
RCGodward

GCC 4.3

Post by RCGodward »

Hello Everyone!
Long time user and lurker, first time poster. I upgraded my Linux box to GCC 4.3, and I had to make a few changes to get ZSNES 1.51 to compile. I figure they might be helpful to someone... mainly Gentoo users, but you never know...

EDIT:
Just noticed 1.51b posted in ZSNES Chat. Guess I'm behind the times. Sorry.

Code: Select all

diff -r src/parsegen.cpp ../zsnes_1_51_gcc43/src/parsegen.cpp
28a29
> #include <string.h>
1825c1826
< int main(size_t argc, const char *const *const argv)
---
> int main(int argc, const char *const *const argv)
diff -r src/tools/depbuild.cpp ../zsnes_1_51_gcc43/src/tools/depbuild.cpp
26a27
> #include <stdlib.h>
186c187
< int main(size_t argc, const char *const *const argv)
---
> int main(int argc, const char *const *const argv)
diff -r src/tools/strutil.h ../zsnes_1_51_gcc43/src/tools/strutil.h
25a26
> #include <string.h>
Works fine on 4.3 and 4.1, so I don't think I broke anything. Use at your own risk and all that jazz.
blargg
Regular
Posts: 327
Joined: Thu Jun 30, 2005 1:54 pm
Location: USA
Contact:

Post by blargg »

As a side note, the only two forms of main guaranteed by the standard are (note the lack of const)

Code: Select all

int main(void) { /* ... */ }
int main(int argc, char *argv[]) { /* ... */ }
5.1.2.2.1 in the C99 standard, 3.6.1 in the C++ standard.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

blargg wrote:As a side note, the only two forms of main guaranteed by the standard are (note the lack of const)

Code: Select all

int main(void) { /* ... */ }
int main(int argc, char *argv[]) { /* ... */ }
5.1.2.2.1 in the C99 standard, 3.6.1 in the C++ standard.
I am aware of that, and forgive me for being overzealous in consting something that can segfault if you modify it (the last const can be dropped if desired, since that's local).

And BTW, I don't recall which standard it is, but there's one which allows a third environ parameter.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Post Reply