age icon indicating copy to clipboard operation
age copied to clipboard

Warning when building AGE on MacOS

Open saygoodbyye opened this issue 11 months ago • 3 comments

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 avatar Mar 12 '24 07:03 saygoodbyye

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.

Muhammad00Taha avatar Mar 14 '24 20:03 Muhammad00Taha

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.

diangamichael avatar Apr 25 '24 15:04 diangamichael

This issue is stale because it has been open 60 days with no activity. Remove "Abondoned" label or comment or this will be closed in 14 days.

github-actions[bot] avatar Jun 25 '24 00:06 github-actions[bot]

This issue was closed because it has been stalled for further 14 days with no activity.

github-actions[bot] avatar Jul 09 '24 00:07 github-actions[bot]