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

Warning when building AGE on MacOS #1662

Open
saygoodbyye opened this issue Mar 12, 2024 · 2 comments
Open

Warning when building AGE on MacOS #1662

saygoodbyye opened this issue Mar 12, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@saygoodbyye
Copy link
Contributor

Describe the bug
Warning when building AGE on MacOS

How are you accessing AGE (Command line, driver, etc.)?
Accessing AGE through command line.

What data setup do we need to do?
Apache AGE (PG15 branch) with PostgreSQL (REL_15_STABLE).

What is the necessary configuration info needed?
MacOS Sonoma 14.4

egor@MacBook-Air-Egor ~/Work/age (PG15) $ clang --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
./configure CFLAGS=" -Og" --enable-tap-tests --enable-debug --enable-cassert --prefix=/tmp/pgsql

What is the command that caused the error?

egor@MacBook-Air-Egor ~/Work/age (PG15) $ make
src/backend/parser/cypher_gram.c:2198:5: warning: variable 'cypher_yynerrs' set but not used [-Wunused-but-set-variable]
int yynerrs;
    ^
src/backend/parser/cypher_gram.c:68:17: note: expanded from macro 'yynerrs'
#define yynerrs cypher_yynerrs
                ^
1 warning generated.

Expected behavior
Build without warnings

Best regards,
Egor Chindyaskin
Postgres Professional: https://postgrespro.com/

@saygoodbyye saygoodbyye added the bug Something isn't working label Mar 12, 2024
@Muhammad00Taha
Copy link

To resolve this warning, you could consider removing or modifying the declaration of cypher_yynerrs in the cypher_gram.c file. Since it's not being used, removing it entirely should resolve the warning.

@diangamichael
Copy link

The warning you're encountering during the build process of Apache AGE on MacOS is related to an unused variable cypher_yynerrs in the generated cypher_gram.c file. This warning doesn't necessarily indicate an error, but it's informing you that the variable is defined but not used within the code.

To resolve this warning, you can either remove the unused variable or suppress the warning altogether.

Here's how you can address it:

Remove the Unused Variable:
You can edit the cypher_gram.c file and remove the declaration of cypher_yynerrs if it's not needed for any future use. However, be cautious when modifying generated code as it might affect the functionality of the parser.
Suppress the Warning:
If you prefer not to modify the generated code, you can suppress the warning using compiler directives. For example, if you're using GCC or Clang, you can use the -Wno-unused-but-set-variable flag to suppress this specific warning. Add this flag to your CFLAGS when configuring or compiling AGE.

./configure CFLAGS="-Og -Wno-unused-but-set-variable" --enable-tap-tests --enable-debug --enable-cassert --prefix=/tmp/pgsql

Adding this flag instructs the compiler to ignore warnings about unused but set variables, which includes cypher_yynerrs in this case.
By removing the warning or suppressing it, you should be able to build Apache AGE without encountering this specific issue. However, always ensure that the changes made do not introduce unintended consequences to the functionality or stability of the codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants