pganalyze / pg_query_go

Go library to parse and normalize SQL queries using the PostgreSQL query parser
BSD 3-Clause "New" or "Revised" License
663 stars 79 forks source link

[MacOS] warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] #81

Closed manitgupta closed 1 year ago

manitgupta commented 1 year ago

I started seeing the following warnings recently while building the upstream package of pg_query_go when building on MacOS -

MacOS Ventura - 13.3
Xcode version - version: 14.3.0.0.1.1679647830

Could you please help me understand the issue? I see that the sprintf issue would is already logged on #67 and will be fixed in the subsequent release. Not sure about the passing arguments to a function..

❯ make build
go build
# github.com/pganalyze/pg_query_go/v2/parser
src_backend_nodes_nodeFuncs.c:923:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:925:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:930:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:933:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:941:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:948:16: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:950:16: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:953:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:959:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:961:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:963:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:968:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:971:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:976:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:978:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:983:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:985:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:987:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:989:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:998:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1002:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1009:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1017:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1019:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1021:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1023:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1025:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1027:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1035:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1037:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1039:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1041:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1043:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1051:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1053:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1055:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1057:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1059:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1061:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1069:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1071:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1073:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1075:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1077:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1079:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1081:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1083:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1085:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1087:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1089:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1091:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1093:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1095:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1097:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1099:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1107:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1109:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1118:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1129:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1131:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1133:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1135:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1141:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1146:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1148:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1156:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1158:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1163:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1168:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1170:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1175:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1180:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1182:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1187:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1189:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1194:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1196:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1198:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1200:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1208:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1210:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1218:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1220:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1222:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1230:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1233:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1235:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1243:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1245:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1247:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1249:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1251:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1259:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1261:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1269:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1271:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1280:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1282:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1284:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1293:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1299:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1301:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1306:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1308:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1313:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1318:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1320:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1328:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1330:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1332:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1337:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
# github.com/pganalyze/pg_query_go/v2/parser
src_port_snprintf.c:1030:11: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
src_port_snprintf.c:1212:13: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
src_port_snprintf.c:1219:13: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
lfittl commented 1 year ago

@manitgupta Thanks for the report!

Could you check out the current version (v4) and see whether that reproduces the same issue?

manitgupta commented 1 year ago

After updating to pg_query_go v4, I am seeing some compile issues due to changed interfaces. I am not that well versed in this library, so posting the errors here (please bear with me) -

Screenshot 2023-04-04 at 12 43 29 PM Screenshot 2023-04-04 at 12 43 37 PM

Looks like the A_Const struct has changed between v2 and v4. The new struct is as follows -

type A_Const struct {
    state         protoimpl.MessageState
    sizeCache     protoimpl.SizeCache
    unknownFields protoimpl.UnknownFields

    // Types that are assignable to Val:
    //
    //  *A_Const_Ival
    //  *A_Const_Fval
    //  *A_Const_Boolval
    //  *A_Const_Sval
    //  *A_Const_Bsval
    Val      isA_Const_Val `protobuf_oneof:"val"`
    Isnull   bool          `protobuf:"varint,10,opt,name=isnull,proto3" json:"isnull,omitempty"`
    Location int32         `protobuf:"varint,11,opt,name=location,proto3" json:"location,omitempty"`
}

While the older struct was -

type A_Const struct {
    state         protoimpl.MessageState
    sizeCache     protoimpl.SizeCache
    unknownFields protoimpl.UnknownFields

    Val      *Node `protobuf:"bytes,1,opt,name=val,proto3" json:"val,omitempty"`
    Location int32 `protobuf:"varint,2,opt,name=location,proto3" json:"location,omitempty"`
}

Specifically, the data type of Val field has changed from *Node to isA_Const_Val. This is causing breaking changes in the API. Do you have an understanding of what changes need to be made here?

Link to code in the original repo -

  1. https://github.com/cloudspannerecosystem/harbourbridge/blob/master/sources/postgres/pgdump.go#L483
  2. https://github.com/cloudspannerecosystem/harbourbridge/blob/master/sources/postgres/pgdump.go#L506
  3. https://github.com/cloudspannerecosystem/harbourbridge/blob/master/sources/postgres/pgdump.go#L789
lfittl commented 1 year ago

After updating to pg_query_go v4, I am seeing some compile issues due to changed interfaces. I am not that well versed in this library, so posting the errors here (please bear with me) -

...

Looks like the A_Const struct has changed between v2 and v4. The new struct is as follows -

...

That's correct - this is due to an upstream change in the Postgres node structs, which pg_query bases the parse tree objects on.

I unfortunately don't have the capacity to help with changes on the Google HarbourBridge repository that uses pg_query_go here due to time constraints (in addition to not being familiar with that code base).

My recommendation would be to work with the original authors of the HarbourBridge code to adapt it to the new parse node definitions from Postgres 15. I imagine this would be a goal anyway to support Postgres 15 syntax in HarbourBridge.

kyleconroy commented 1 year ago

I'm seeing these same warnings using v4 in sqlc. I'm on macOS 13.2. Inside of the sqlc repository, you can reproduce by doing the following:

$ make sqlc-dev
go build -o ~/bin/sqlc-dev ./cmd/sqlc/
# github.com/pganalyze/pg_query_go/v4/parser
src_backend_nodes_nodeFuncs.c:925:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:927:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:932:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:935:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:943:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:950:16: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:952:16: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:955:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:961:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:963:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:965:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:970:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:973:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:978:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:980:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:985:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:987:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:989:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:991:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1000:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1004:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1011:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1019:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1021:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1023:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1025:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1027:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1029:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1037:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1039:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1041:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1043:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1045:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1053:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1055:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1057:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1059:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1061:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1063:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1071:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1073:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1075:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1077:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1079:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1087:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1089:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1091:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1099:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1101:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1103:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1105:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1107:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1109:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1111:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1113:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1115:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1117:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1119:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1121:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1123:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1125:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1127:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1129:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1137:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1139:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1147:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1149:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1158:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1169:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1171:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1173:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1175:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1181:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1186:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1188:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1196:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1198:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1203:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1208:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1210:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1215:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1220:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1222:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1227:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1229:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1234:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1236:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1238:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1240:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1248:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1250:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1258:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1260:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1262:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1270:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1273:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1275:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1283:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1285:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1287:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1289:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1291:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1299:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1301:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1309:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1311:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1320:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1322:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1324:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1326:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1335:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1341:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1343:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1348:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1350:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1355:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1360:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1362:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1370:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1372:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1374:15: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
src_backend_nodes_nodeFuncs.c:1380:17: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
lfittl commented 1 year ago

I'm seeing these same warnings using v4 in sqlc. I'm on macOS 13.2. Inside of the sqlc repository, you can reproduce by doing the following:

Thanks for flagging this also occurs on v4. We'll see if that's an easy fix, might just be a matter of turning off the warning. /cc @msepga

Yiwen-Gao commented 1 year ago

I'm seeing the same warnings as @kyleconroy when using sqlc.

msepga commented 1 year ago

I believe this is now fixed in #83