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

Double defined Symbol Warning #27

Open
xXorAa opened this issue Jan 23, 2023 · 3 comments
Open

Double defined Symbol Warning #27

xXorAa opened this issue Jan 23, 2023 · 3 comments

Comments

@xXorAa
Copy link
Contributor

xXorAa commented Jan 23, 2023

xtc68 issues these warnings where it probably should not.

test.txt

Attached a test program, the compiled version of which works as it prints 2 3 when run so the symbols are not actually overwriting each other like the warning would indicate.

qcc -o test-c68 test.c
Double defined Symbol: _ONE
test-c68: dataspace 870 (366)
Multiply defined :        1
@stronnag
Copy link
Owner

The warning is valid; historically, QDOS/c68 uses upper case for SROFF XDEF tokens.
The attached is a slightly less trivial example. It may not behave as you expect as the symbol is imported once.
Given the historical aspect (and all libc XDEFs are upper case), I'm minded not to remove the warning.

qltest.tar.gz

@xXorAa
Copy link
Contributor Author

xXorAa commented Jan 24, 2023

I see what you mean. That is a gotcha when porting C stuff to QL.

I guess we leave this issue open so the next time someone stumbles on it they know what is going on!

@stronnag stronnag added wontfix and removed wontfix labels Jan 24, 2023
@stronnag
Copy link
Owner

And in the original single compilation unit case, if you do the "right" thing and define the variables as static; then the problem also goes away.

That is a gotcha when porting C stuff to QL.

Indeed, as is the fact that C68 is so old, ANSI C only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants