Skip to content

Silence Clang’s -Wunreachable-code warnings#84

Open
johnsonjh wants to merge 1 commit intomasterfrom
johnsonjh/20241020/unreachable-code
Open

Silence Clang’s -Wunreachable-code warnings#84
johnsonjh wants to merge 1 commit intomasterfrom
johnsonjh/20241020/unreachable-code

Conversation

@johnsonjh
Copy link
Collaborator

@johnsonjh johnsonjh commented Oct 21, 2024

Double-check these — the changes here only silences the warnings.

Silence Clang’s -Wunreachable-code warnings:

src/loader.c:61:17: warning: code will never be executed [-Wunreachable-code]
   61 |             c = '+';
src/loader.c:149:30: warning: code will never be executed [-Wunreachable-code]
  149 |                     offset = fcb2 + 1;
src/loader.c:156:30: warning: code will never be executed [-Wunreachable-code]
  156 |                     offset = fcb2 + 1;
src/loader.c:195:30: warning: code will never be executed [-Wunreachable-code]
  195 |                     offset = fcb2 + 9;
src/loader.c:214:30: warning: code will never be executed [-Wunreachable-code]
  214 |                     offset = fcb2 + 1;
src/loader.c:221:30: warning: code will never be executed [-Wunreachable-code]
  221 |                     offset = fcb2 + 1;

src/loader.c:61:17: warning: code will never be executed [-Wunreachable-code]
   61 |             c = '+';

src/loader.c:149:30: warning: code will never be executed [-Wunreachable-code]
  149 |                     offset = fcb2 + 1;

src/loader.c:156:30: warning: code will never be executed [-Wunreachable-code]
  156 |                     offset = fcb2 + 1;

src/loader.c:195:30: warning: code will never be executed [-Wunreachable-code]
  195 |                     offset = fcb2 + 9;

src/loader.c:214:30: warning: code will never be executed [-Wunreachable-code]
  214 |                     offset = fcb2 + 1;

src/loader.c:221:30: warning: code will never be executed [-Wunreachable-code]
  221 |                     offset = fcb2 + 1;

Signed-off-by: Jeffrey H. Johnson <trnsz@pobox.com>
@johnsonjh johnsonjh requested a review from dmsc October 21, 2024 02:59
@johnsonjh johnsonjh self-assigned this Oct 21, 2024
@johnsonjh johnsonjh changed the title Silence Clang's -Wunreachable-code warnings Silence Clang’s -Wunreachable-code warnings Oct 21, 2024
@dmsc
Copy link
Owner

dmsc commented Oct 21, 2024

Don't really like this - as the code is left unreachable on purpose, depending on the value of the macro. The (1) seems a hack that will break on other compilers.

The question should be - it is useful for the emulator to parse the FCB in DOS 1, 2 or 3 modes? If it is a useful feature, perhaps we should add a command line option to select the mode.

Thanks!

@johnsonjh
Copy link
Collaborator Author

johnsonjh commented Oct 21, 2024 via email

@johnsonjh
Copy link
Collaborator Author

@dmsc should I close this one out?

@dmsc
Copy link
Owner

dmsc commented Oct 27, 2024

@dmsc should I close this one out?

I will keep it open until I do a proper fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants