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

Remove K&R function declaration from flex. #323

Closed
wants to merge 1 commit into from
Closed

Remove K&R function declaration from flex. #323

wants to merge 1 commit into from

Conversation

ericonr
Copy link
Contributor

@ericonr ericonr commented Jan 17, 2023

A common header is a more adequate long term solution for this purpose. This commit only intends to fix a compilation error reported on the mailing list [1].

[1] https://epics.anl.gov/tech-talk/2023/msg00050.php

A common header is a more adequate long term solution for this purpose.
This commit only intends to fix a compilation error reported on the
mailing list [1].

[1] https://epics.anl.gov/tech-talk/2023/msg00050.php
@mdavidsaver
Copy link
Member

So far we have tried to avoid further patching of our bundled forks of flex and yacc. That said, the code has already been extensively patch, and this change is trivial.

Before applying, I'd like to understand if some newer C compiler really has started to reject K&R syntax by default.

fyi. My abandoned attempt to update the bundled flex/yacc: https://github.com/mdavidsaver/epics-base/tree/lexyacc-update

@ericonr
Copy link
Contributor Author

ericonr commented Jan 17, 2023

Before applying, I'd like to understand if some newer C compiler really has started to reject K&R syntax by default.

That's fair, I am quite curious about it myself. A C++ compiler being used (as you mentioned in tech-talk) crossed my mind, but it seemed unlikely.

Waiting for confirmation that this fixes all the compilation errors might be a good idea as well. I couldn't find a good way to warn on K&R usage when actually passing arguments that doesn't also print warnings for all C functions that are declared with type function(); instead of type function(void); (tried -Wstrict-prototypes).

@AppVeyorBot
Copy link

@mdavidsaver
Copy link
Member

... It was just the g++ compiler; for some reason symlink was not working. ...

https://epics.anl.gov/tech-talk/2023/msg00090.php

@ericonr
Copy link
Contributor Author

ericonr commented Mar 7, 2023

Is it reasonable to support building that code as C++?
I think the commit message is generic enough that it wouldn't have to be changed, either way? Unless you'd like for the last response to be added to it.

@mdavidsaver
Copy link
Member

Is it reasonable to support building that code as C++?

To my mind, no. To do so does not produce the same output. eg. with C++ symbol name mangling.

@anjohnson
Copy link
Member

Core Group: Not a bug, users need to use a C compiler to compile .c code.

@anjohnson anjohnson closed this Mar 29, 2023
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

Successfully merging this pull request may close these issues.

None yet

4 participants