Open tkchia opened 3 years ago
Thanks for reporting it. If you have two declarations (prototypes) then it is merged by rules that resulting prototype can contains modifiers from both prototypes. It could be source of problem in your situation. The mixing of ISO and K&R prototypes is not good practice and I didn't test such use of OW compilers anyway. OW can have some mistake to handle such code. I will fix it.
Hello @jmalak,
Thank you for looking into this. I think it would be helpful if wcc
could at least detect such cases and flag a warning (or error).
Thank you!
I think it is OW bug in merging ISO and K&R prototypes because if I change bar function to be ISO definition then no problem.
Under Open Watcom
wcc
2.0 beta May 17 2020, if I compile the source filewith the command
I get these error messages:
The weirdness seems to be triggered at least when I take the address of a
__far __pascal
function which is declared with a new-style (C89) prototype, but is later defined in an old-style (K&R) way. There was some further weirdness (line 21) when I tried to refer to the address ofbar (
...)
using&bar
instead of justbar
.I came across this problem while trying to get VESA's VBE/AI SDK to build under Open Watcom.
Thank you!