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

libtool: Workaround for issue on clang64 and some debug code. Clang warns a… #2624

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JPeterMugaas
Copy link
Contributor

…nd will sometimes generate an error if the format string is not not a litteral constant ( -Wformat-nonliteral ). That causes some packages to fail to compile. Note that this warning is correct but I consider it harmless in libtool since it is used by libraries for testing and debuggng. libtool really should be properly fixed for this.

…will sometimes generate an error if the format string is not not a litteral constant ( -Wformat-nonliteral ). That causes some packages to fail to compile. Note that this warning is correct but I consider it harmless in libtool since it is used by libraries for testing and debuggng. libtool really should be properly fixed for this.
@jeremyd2019
Copy link
Member

I would suggest instead declaring it with __attribute__ ((format (printf, 3, 4))) and that will then push the format string warning/error onto the caller, where it rightly should be

@JPeterMugaas
Copy link
Contributor Author

Okay. I tried it but gives me syntax errors or something out of range. I do NOT want to mess with that I don't understand and will probably get wrong. I've seen things like 1,2 or 3,4. I don't know.

My solution in pushing the diagnostic settings, ignoring the warning, popping the diagnostic settings in isolated procedures seems to be the most elegant solution that works when compiling stuff that uses libtool. It is a warning but there is something that makes the warning an error.

@lazka
Copy link
Member

lazka commented Sep 1, 2021

Which packages are affected by this problem?

@JPeterMugaas
Copy link
Contributor Author

I was working on an improved lasem package when I noticed the issue.

msys2/MINGW-packages#9514

I was working on lasem so that I could build ruby-mathematical since that would be required for something that can generate OpenCL documentation in PDF format.

and the msys patch is a companion to a pull request I made at:

msys2/MINGW-packages#9496

The problem is that libtool bash script creates code and even a program where a string is being passed to a format function. That causes an error when compiling lasem with clang64 because it's treated as an error instead of a warning.

Both libtool and lasem seem to be relatively unmaintained and they probably did not anticipate what would happen with clang. Unfortunately, there still may be stuff that depends upon these things. I'm working under a less than ideal situation.

@lazka lazka changed the title Workaround for issue on clang64 and some debug code. Clang warns a… libtool: Workaround for issue on clang64 and some debug code. Clang warns a… Sep 9, 2021
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.

3 participants