pete-gordon / oricutron

Portable Oric-1/Atmos/Telestrat and Pravetz 8D emulator
http://www.petergordon.org.uk/oricutron/
GNU General Public License v2.0
69 stars 25 forks source link

Unrechable code warnings when compiling #147

Closed 0ric1 closed 4 years ago

0ric1 commented 4 years ago

filereq_sdl.c or msgbox_sdl.c with Visual Studio 2019 16.4.0 Preview 4.0 SDL_COMPAT_EnableUNICODE( wasunicode ); SDL_COMPAT_EnableKeyRepeat( wasunicode ? SDL_DEFAULT_REPEAT_DELAY : 0, wasunicode ? SDL_DEFAULT_REPEAT_INTERVAL : 0 ); return SDL_FALSE;

assinie commented 4 years ago

Do you have the warnings by compiling with the SDL v1 and SDL v2 library or only with one of the 2 versions?

0ric1 commented 4 years ago

I am compiling with the SDL2.lib but I think it's independent of it, there is a for( ;; ) loop in line 176 and in this loop there is a if and a switch where return SDL_TRUE/FALSE is called. The mentioned code in my first post is never ever called, so there is something in the switch wrong or the code can be removed completely.

iss000 commented 4 years ago

@0ric1: can you paste the part with the warning from compile log?

0ric1 commented 4 years ago

`Console Log

1>oricutron\msgbox_sdl.c(292): warning C4702: unreachable code 1>oricutron\msgbox_sdl.c(293): warning C4702: unreachable code 1>oricutron\msgbox_sdl.c(294): warning C4702: unreachable code 1>oricutron\filereq_sdl.c(753): warning C4702: unreachable code 1>oricutron\filereq_sdl.c(754): warning C4702: unreachable code 1>oricutron\filereq_sdl.c(755): warning C4702: unreachable code `

iss000 commented 4 years ago

Fixed with commit f22aac2.