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

Ambiguous expansion of macro 'MAX' #262

Open
alestiago opened this issue Nov 12, 2024 · 3 comments
Open

Ambiguous expansion of macro 'MAX' #262

alestiago opened this issue Nov 12, 2024 · 3 comments

Comments

@alestiago
Copy link

alestiago commented Nov 12, 2024

The installed sqlite3 Pod by this sqlite3_flutter_libs has a warning on line 31923 of sqlite3 is reporting Ambiguous expansion of macro 'MAX'

zBufNeeded = MAX(e2,0)+(i64)precision+(i64)width+15;

Screenshot

Screenshot 2024-11-12 at 13 31 00

@simolus3
Copy link
Owner

I'm not sure if we can fix that. It's not our code (and we definitely want to keep shipping unchanged sqlite3 amalgamations from upstream).

You can add pod 'sqlite3', :inhibit_warnings => true to the target 'Runner' section of your Podfile to silence this warning. Unfortunately we can't add that anywhere because AFAIK this is only allowed in the root Podfile.
If you or someone with more knowledge about iOS builds has an idea for a workaround to explore, I'm happy to try that. I couldn't figure out how to silence the warning for users though.

@alestiago
Copy link
Author

alestiago commented Jan 2, 2025

Hi @simolus3, I haven't yet tried silencing them. I'm wondering if we could include a documentation section on the docs that explains why and how to deal with these warnings that get introduced when using the package, what do you think?

I did some research, this is what I found when searching for Ambiguous expansion in the SQlite forum, this post "Weird warning on the Xcode/OSX" is quite aligned with what we're experiencing. There seems to be some thoughts from the forum users about it being an XCode or Clang issue.

These are the issues found by searching for "Ambiguous expansion" on the clang repository.

I haven't tried reproducing the warning solely with clang like sbooth user in the SQlite forum did.

@simolus3
Copy link
Owner

simolus3 commented Jan 3, 2025

I've done some research and it turns out that it's only the clang from the macOS/iOS SDK that emits these warnings. A SwiftPM project (without Flutter) compiling sqlite3 works without warnings on my Linux machine, but emits the ambiguous macro warnings when compiled on macOS.

I'm wondering if we could include a documentation section on the docs that explains why and how to deal with these warnings that get introduced when using the package, what do you think?

That's definitely a good idea 👍, I'll add a section to the readme.

And with the migration to SwiftPM, this will luckily not be a problem anymore since we can just do this.

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