Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong code generation for literal (constant) wide-characters strings #1374

Open
plzombie opened this issue Jan 14, 2025 · 4 comments
Open

Wrong code generation for literal (constant) wide-characters strings #1374

plzombie opened this issue Jan 14, 2025 · 4 comments
Labels
bug C C compiler

Comments

@plzombie
Copy link

Reproducible with nt/nt64 compiler (Both debug and release) with this a3d9dea build (Last updated 2025-01-07 03:19:56 UTC)

Compile this snippet as a console windows app (either debug or release)
Run something like test_ow_codegen_failure.exe -layered
You would get message Warning: argument -layered can be set only with -bw
Desired behaviour: nothing should be printed. This code branch should be performed:

flags.type = DEPRESS_PAGE_TYPE_LAYERED;
flags.param1 = 3;
flags.param2 = 2;
@jmalak
Copy link
Member

jmalak commented Jan 16, 2025

Please specify compile and link commands.
I supposed host is 64-bit Windows and OW is properly configured.

@plzombie
Copy link
Author

Here are compile commands

wcc386 main.c -w4 -e25 -zq -od -d2 -6r -bt=nt -fo=.obj -mf
wlink name test_ow_codegen_failure d all sys nt op m op maxe=25 op q file main.obj

Anyway it's default directives from Open Watcom IDE for Debug build.

@jmalak jmalak added bug C C compiler labels Jan 17, 2025
@jmalak
Copy link
Member

jmalak commented Jan 17, 2025

It looks like mistake in wide-characters strings handling.

@jmalak
Copy link
Member

jmalak commented Jan 17, 2025

As the workaround you can use in the source file at the beginning

#pragma off (reuse_duplicate_strings)

Of cause it will be fixed.

@jmalak jmalak changed the title Wrong code generation for complex if..else if Wrong code generation for literal (constant) wide-characters strings Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug C C compiler
Projects
None yet
Development

No branches or pull requests

2 participants