datajerk / c2t

Retro Code (Apple II, Cosmac VIP) to Tape/Text
BSD 3-Clause "New" or "Revised" License
64 stars 11 forks source link

Enable more warnings #28

Open ryandesign opened 10 months ago

ryandesign commented 10 months ago

Consider enabling -Wextra and -Wpedantic to see a bunch of warnings about your code such as:

c2t.c:244:12: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                for(j=0;j<strlen(argv[i]);j++) {
                        ~^~~~~~~~~~~~~~~~

and:

c2t.c:1436:11: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void usage()
          ^
           void

and:

./fake6502.h:995:22: warning: assigning to 'void (*)()' from 'void *' converts between void pointer and function pointer [-Wpedantic]
        loopexternal = funcptr;
                     ^ ~~~~~~~

You currently repeat the warning flags in several places in the Makefile. Consider using a variable to store them so you only have to update them in one place in the future.

datajerk commented 10 months ago

thanks, will add to backlog