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

Warnings issued by gcc compiling deparse.c #200

Closed
lelit opened this issue Jul 10, 2023 · 3 comments
Closed

Warnings issued by gcc compiling deparse.c #200

lelit opened this issue Jul 10, 2023 · 3 comments

Comments

@lelit
Copy link
Contributor

lelit commented Jul 10, 2023

Trying out recently released 4.2.2, I see the following:

...
compiling src/pg_query_scan.c
compiling src/pg_query_split.c
compiling src/postgres_deparse.c
In file included from ./src/postgres/include/nodes/primnodes.h:22,
                 from ./src/postgres/include/nodes/parsenodes.h:27,
                 from ./src/postgres/include/catalog/objectaddress.h:17,
                 from ./src/postgres/include/catalog/index.h:17,
                 from src/postgres_deparse.c:2:
src/postgres_deparse.c: In function ‘deparseCreateFunctionStmt’:
src/postgres_deparse.c:4906:58: warning: passing argument 1 of ‘list_nth_cell’ from incompatible pointer type [-Wincompatible-pointer-types]
 4906 |                         if (linitial(create_function_stmt->sql_body) != NULL)
      |                                      ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
      |                                                          |
      |                                                          Node *
./src/postgres/include/nodes/pg_list.h:169:51: note: in definition of macro ‘lfirst’
  169 | #define lfirst(lc)                              ((lc)->ptr_value)
      |                                                   ^~
src/postgres_deparse.c:4906:29: note: in expansion of macro ‘linitial’
 4906 |                         if (linitial(create_function_stmt->sql_body) != NULL)
      |                             ^~~~~~~~
./src/postgres/include/nodes/pg_list.h:256:27: note: expected ‘const List *’ but argument is of type ‘Node *’
  256 | list_nth_cell(const List *list, int n)
      |               ~~~~~~~~~~~~^~~~
In file included from ./src/postgres/include/nodes/pg_list.h:40:
src/postgres_deparse.c:4908:100: warning: passing argument 1 of ‘list_nth_cell’ from incompatible pointer type [-Wincompatible-pointer-types]
 4908 |                                 List *body_stmt_list = castNode(List, linitial(create_function_stmt->sql_body));
      |                                                                                ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
      |                                                                                                    |
      |                                                                                                    Node *
./src/postgres/include/nodes/nodes.h:614:48: note: in definition of macro ‘castNode’
  614 | #define castNode(_type_, nodeptr) ((_type_ *) (nodeptr))
      |                                                ^~~~~~~
./src/postgres/include/nodes/pg_list.h:174:49: note: in expansion of macro ‘lfirst’
  174 | #define linitial(l)                             lfirst(list_nth_cell(l, 0))
      |                                                 ^~~~~~
src/postgres_deparse.c:4908:71: note: in expansion of macro ‘linitial’
 4908 |                                 List *body_stmt_list = castNode(List, linitial(create_function_stmt->sql_body));
      |                                                                       ^~~~~~~~
./src/postgres/include/nodes/pg_list.h:256:27: note: expected ‘const List *’ but argument is of type ‘Node *’
  256 | list_nth_cell(const List *list, int n)
      |               ~~~~~~~~~~~~^~~~
compiling src/postgres/src_backend_catalog_namespace.c
compiling src/postgres/src_backend_catalog_pg_proc.c
...
@lfittl
Copy link
Member

lfittl commented Jul 10, 2023

Thanks for the report!

This is fixed in #199 - aiming to release this as 15-4.2.3 soon.

@lelit
Copy link
Contributor Author

lelit commented Jul 10, 2023

Thank you, I missed that!

@lelit
Copy link
Contributor Author

lelit commented Aug 5, 2023

This is solved in just released 15-4.2.3, thanks.

@lelit lelit closed this as completed Aug 5, 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

No branches or pull requests

2 participants