stardot / b-em

An opensource BBC Micro emulator for Win32 and Linux
http://stardot.org.uk/forums/viewtopic.php?f=4&t=10823
GNU General Public License v2.0
112 stars 56 forks source link

Minor build warning on macOS #201

Closed rjpontefract closed 1 year ago

rjpontefract commented 1 year ago

When building on macOS with Apple Clang 14.0.3 I get the following build warning:

  CC       NS32016/b_em-Decode.o
NS32016/32016.c:511:28: warning: passing arguments to 'n32016_dumpregs' without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
            n32016_dumpregs("Bad NS32016 gen mode");

It looks as though

extern void n32016_dumpregs();

in Trap.h should be:

extern void n32016_dumpregs(char *);

SteveFosdick commented 1 year ago

Actually, looking at the passed in string, I think it should be:

extern void n32016_dumpregs(const char *);

As literal strings can be placed in read-only storage. Could you try that and, if it compiles without warning, I will make the change.

rjpontefract commented 1 year ago

That's what I thought, but I just made the prototype the same as the function in Trap.c. However, changing them both to const char * works and is a better solution.

SteveFosdick commented 1 year ago

Fix pushed: https://github.com/stardot/b-em/commit/229222cc0f74b83f41bd9235c0fb35f9f30fec27