tjko / jpeginfo

jpeginfo - prints information and tests integrity of JPEG/JFIF files
http://www.iki.fi/tjko/projects.html
GNU General Public License v3.0
139 stars 17 forks source link

getopt.c md5.c: Remove register. #25

Closed schwehr closed 10 months ago

schwehr commented 10 months ago

register is no longer needed for modern compilers.

schwehr commented 10 months ago

Why remove 'register'? I recall current gcc will ignore it at least on x86, but other platforms/compilers might benefit from it...

It's probably been 2 decades since any compiler needed a hint about registers for local variables. C++ has nuked the keyword and in C it now only stops you from taking the pointer to a variable.

https://en.wikipedia.org/wiki/Register_(keyword)

The getopt calls are never going to matter for performance even back in the k&r / c89 world of the 80s and 90s.

For md5, if you want to try out lots of compilers, you can use this compiler explorer starter and compare the resulting asm: https://godbolt.org/z/n5jrx4az7