This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new b51a5d186 fix(c/driver/postgresql): Fix warning when compiling
PostgreSQL driver on RTools/msys2 (#3903)
b51a5d186 is described below
commit b51a5d186bdde77af7d1abf6f9c06f2935fd1d26
Author: Dewey Dunnington <[email protected]>
AuthorDate: Tue Jan 20 23:29:37 2026 -0600
fix(c/driver/postgresql): Fix warning when compiling PostgreSQL driver on
RTools/msys2 (#3903)
When submitting ADBC 22 to CRAN I get:
```
* checking whether package 'adbcpostgresql' can be installed ... WARNING
Found the following significant warnings:
D:/rtools45/x86_64-w64-mingw32.static.posix/include/winsock2.h:15:2:
warning: #warning Please include winsock2.h before windows.h [-Wcpp]
See 'd:/RCompile/CRANguest/R-devel/adbcpostgresql.Rcheck/00install.out' for
details.
```
The full install log is at
https://win-builder.r-project.org/Ao3b73sGP2Mq/00install.out
<details>
```
* installing *source* package 'adbcpostgresql' ...
** this is package 'adbcpostgresql' version '0.22.0'
** using staged installation
**********************************************
WARNING: this package has a configure script
It probably needs manual configuration
**********************************************
** libs
specified C++17
using C++ compiler: 'g++.exe (GCC) 14.3.0'
using C++17
g++ -std=gnu++17 -I"D:/RCompile/recent/R/include" -DNDEBUG -I../src/c
-I../src/c/include -I../src/c/vendor/
-I../src/c/vendor/portable-snippets/include/ -I../src/c/vendor/fmt/include
-DADBC_EXPORT="" -D__USE_MINGW_ANSI_STDIO -DFMT_HEADER_ONLY=1
-I"d:/rtools45/x86_64-w64-mingw32.static.posix/include" -O2 -Wall
-mfpmath=sse -msse2 -mstackrealign -c init.cc -o init.o
gcc -I"D:/RCompile/recent/R/include" -DNDEBUG -I../src/c
-I../src/c/include -I../src/c/vendor/
-I../src/c/vendor/portable-snippets/include/ -I../src/c/vendor/fmt/include
-DADBC_EXPORT="" -D__USE_MINGW_ANSI_STDIO -DFMT_HEADER_ONLY=1
-I"d:/rtools45/x86_64-w64-mingw32.static.posix/include" -pedantic
-Wstrict-prototypes -O2 -Wall -std=gnu2x -mfpmath=sse -msse2 -mstackrealign
-c c/driver/common/utils.c -o c/driver/common/utils.o
g++ -std=gnu++17 -I"D:/RCompile/recent/R/include" -DNDEBUG -I../src/c
-I../src/c/include -I../src/c/vendor/
-I../src/c/vendor/portable-snippets/include/ -I../src/c/vendor/fmt/include
-DADBC_EXPORT="" -D__USE_MINGW_ANSI_STDIO -DFMT_HEADER_ONLY=1
-I"d:/rtools45/x86_64-w64-mingw32.static.posix/include" -O2 -Wall
-mfpmath=sse -msse2 -mstackrealign -c c/driver/framework/objects.cc -o
c/driver/framework/objects.o
In file included from
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/vector:66,
from ../src/c/driver/framework/objects.h:22,
from c/driver/framework/objects.cc:18:
In member function 'void std::_Vector_base<_Tp,
_Alloc>::_M_deallocate(pointer, std::size_t) [with _Tp =
adbc::driver::GetObjectsHelper::ConstraintUsage; _Alloc =
std::allocator<adbc::driver::GetObjectsHelper::ConstraintUsage>]',
inlined from 'std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp
= adbc::driver::GetObjectsHelper::ConstraintUsage; _Alloc =
std::allocator<adbc::driver::GetObjectsHelper::ConstraintUsage>]' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/bits/stl_vector.h:371:15,
inlined from 'std::vector<_Tp, _Alloc>::~vector() [with _Tp =
adbc::driver::GetObjectsHelper::ConstraintUsage; _Alloc =
std::allocator<adbc::driver::GetObjectsHelper::ConstraintUsage>]' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/bits/stl_vector.h:751:7,
inlined from 'constexpr void
std::_Optional_payload_base<_Tp>::_M_destroy() [with _Tp =
std::vector<adbc::driver::GetObjectsHelper::ConstraintUsage>]' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:283:35,
inlined from 'constexpr void
std::_Optional_payload_base<_Tp>::_M_reset() [with _Tp =
std::vector<adbc::driver::GetObjectsHelper::ConstraintUsage>]' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:314:14,
inlined from 'std::_Optional_payload<_Tp, false, _Copy,
_Move>::~_Optional_payload() [with _Tp =
std::vector<adbc::driver::GetObjectsHelper::ConstraintUsage>; bool _Copy =
false; bool _Move = false]' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:437:65,
inlined from
'std::_Optional_base<std::vector<adbc::driver::GetObjectsHelper::ConstraintUsage>,
false, false>::~_Optional_base()' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:508:12,
inlined from
'std::optional<std::vector<adbc::driver::GetObjectsHelper::ConstraintUsage>
>::~optional()' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:703:11,
inlined from
'adbc::driver::GetObjectsHelper::Constraint::~Constraint()' at
../src/c/driver/framework/objects.h:91:10,
inlined from 'constexpr void
std::_Optional_payload_base<_Tp>::_M_destroy() [with _Tp =
adbc::driver::GetObjectsHelper::Constraint]' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:283:35,
inlined from 'constexpr void
std::_Optional_payload_base<_Tp>::_M_reset() [with _Tp =
adbc::driver::GetObjectsHelper::Constraint]' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:314:14,
inlined from 'std::_Optional_payload<_Tp, false, _Copy,
_Move>::~_Optional_payload() [with _Tp =
adbc::driver::GetObjectsHelper::Constraint; bool _Copy = false; bool _Move =
false]' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:437:65,
inlined from
'std::_Optional_base<adbc::driver::GetObjectsHelper::Constraint, false,
false>::~_Optional_base()' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:508:12,
inlined from
'std::optional<adbc::driver::GetObjectsHelper::Constraint>::~optional()' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:703:11,
inlined from 'adbc::driver::Status
adbc::driver::{anonymous}::GetObjectsBuilder::AppendConstraints(std::string_view,
std::string_view, std::string_view)' at c/driver/framework/objects.cc:467:5,
inlined from 'adbc::driver::Status
adbc::driver::{anonymous}::GetObjectsBuilder::AppendTables(std::string_view,
std::string_view)' at c/driver/framework/objects.cc:341:9,
inlined from 'adbc::driver::Status
adbc::driver::{anonymous}::GetObjectsBuilder::AppendSchemas(std::string_view)'
at c/driver/framework/objects.cc:317:9,
inlined from 'adbc::driver::Status
adbc::driver::{anonymous}::GetObjectsBuilder::AppendCatalogs()' at
c/driver/framework/objects.cc:298:9,
inlined from 'adbc::driver::Status
adbc::driver::{anonymous}::GetObjectsBuilder::Build()' at
c/driver/framework/objects.cc:274:5,
inlined from 'adbc::driver::Status
adbc::driver::BuildGetObjects(GetObjectsHelper*, GetObjectsDepth,
std::optional<std::basic_string_view<char> >,
std::optional<std::basic_string_view<char> >,
std::optional<std::basic_string_view<char> >,
std::optional<std::basic_string_view<char> >, const
std::vector<std::basic_string_view<char> >&, ArrowArrayStream*)' at
c/driver/framework/objects.cc:526:3:
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/bits/stl_vector.h:391:9:
warning: '((std::_Vector_base<adbc::driver::GetObjectsHelper::ConstraintUsage,
std::allocator<adbc::driver::GetObjectsHelper::ConstraintUsage>
>::_Vector_impl_data*)((char*)&maybe_constraint +
offsetof(std::optional<adbc::driver::GetObjectsHelper::Constraint>,std::optional<adbc::driver::GetObjectsHelper::Constraint>::<unnamed>.std::_Optional_base<adbc::driver
[...]
391 | if (__p)
| ^~
In file included from ../src/c/driver/framework/objects.h:25:
c/driver/framework/objects.cc: In function 'adbc::driver::Status
adbc::driver::BuildGetObjects(GetObjectsHelper*, GetObjectsDepth,
std::optional<std::basic_string_view<char> >,
std::optional<std::basic_string_view<char> >,
std::optional<std::basic_string_view<char> >,
std::optional<std::basic_string_view<char> >, const
std::vector<std::basic_string_view<char> >&, ArrowArrayStream*)':
c/driver/framework/objects.cc:418:26: note:
'((std::_Vector_base<adbc::driver::GetObjectsHelper::ConstraintUsage,
std::allocator<adbc::driver::GetObjectsHelper::ConstraintUsage>
>::_Vector_impl_data*)((char*)&maybe_constraint +
offsetof(std::optional<adbc::driver::GetObjectsHelper::Constraint>,std::optional<adbc::driver::GetObjectsHelper::Constraint>::<unnamed>.std::_Optional_base<adbc::driver::GetObjectsHelper::Constraint,
false, false>::_M_payload.std::_Optional_payload<adbc::driver [...]
418 | UNWRAP_RESULT(auto maybe_constraint,
helper->NextConstraint());
| ^~~~~~~~~~~~~~~~
../src/c/driver/framework/status.h:265:3: note: in definition of macro
'UNWRAP_RESULT_IMPL'
265 | lhs = std::move((name).value());
| ^~~
c/driver/framework/objects.cc:418:7: note: in expansion of macro
'UNWRAP_RESULT'
418 | UNWRAP_RESULT(auto maybe_constraint,
helper->NextConstraint());
| ^~~~~~~~~~~~~
In destructor 'std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp =
adbc::driver::GetObjectsHelper::ConstraintUsage; _Alloc =
std::allocator<adbc::driver::GetObjectsHelper::ConstraintUsage>]',
inlined from 'std::vector<_Tp, _Alloc>::~vector() [with _Tp =
adbc::driver::GetObjectsHelper::ConstraintUsage; _Alloc =
std::allocator<adbc::driver::GetObjectsHelper::ConstraintUsage>]' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/bits/stl_vector.h:751:7,
inlined from 'constexpr void
std::_Optional_payload_base<_Tp>::_M_destroy() [with _Tp =
std::vector<adbc::driver::GetObjectsHelper::ConstraintUsage>]' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:283:35,
inlined from 'constexpr void
std::_Optional_payload_base<_Tp>::_M_reset() [with _Tp =
std::vector<adbc::driver::GetObjectsHelper::ConstraintUsage>]' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:314:14,
inlined from 'std::_Optional_payload<_Tp, false, _Copy,
_Move>::~_Optional_payload() [with _Tp =
std::vector<adbc::driver::GetObjectsHelper::ConstraintUsage>; bool _Copy =
false; bool _Move = false]' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:437:65,
inlined from
'std::_Optional_base<std::vector<adbc::driver::GetObjectsHelper::ConstraintUsage>,
false, false>::~_Optional_base()' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:508:12,
inlined from
'std::optional<std::vector<adbc::driver::GetObjectsHelper::ConstraintUsage>
>::~optional()' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:703:11,
inlined from
'adbc::driver::GetObjectsHelper::Constraint::~Constraint()' at
../src/c/driver/framework/objects.h:91:10,
inlined from 'constexpr void
std::_Optional_payload_base<_Tp>::_M_destroy() [with _Tp =
adbc::driver::GetObjectsHelper::Constraint]' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:283:35,
inlined from 'constexpr void
std::_Optional_payload_base<_Tp>::_M_reset() [with _Tp =
adbc::driver::GetObjectsHelper::Constraint]' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:314:14,
inlined from 'std::_Optional_payload<_Tp, false, _Copy,
_Move>::~_Optional_payload() [with _Tp =
adbc::driver::GetObjectsHelper::Constraint; bool _Copy = false; bool _Move =
false]' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:437:65,
inlined from
'std::_Optional_base<adbc::driver::GetObjectsHelper::Constraint, false,
false>::~_Optional_base()' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:508:12,
inlined from
'std::optional<adbc::driver::GetObjectsHelper::Constraint>::~optional()' at
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/optional:703:11,
inlined from 'adbc::driver::Status
adbc::driver::{anonymous}::GetObjectsBuilder::AppendConstraints(std::string_view,
std::string_view, std::string_view)' at c/driver/framework/objects.cc:467:5,
inlined from 'adbc::driver::Status
adbc::driver::{anonymous}::GetObjectsBuilder::AppendTables(std::string_view,
std::string_view)' at c/driver/framework/objects.cc:341:9,
inlined from 'adbc::driver::Status
adbc::driver::{anonymous}::GetObjectsBuilder::AppendSchemas(std::string_view)'
at c/driver/framework/objects.cc:317:9,
inlined from 'adbc::driver::Status
adbc::driver::{anonymous}::GetObjectsBuilder::AppendCatalogs()' at
c/driver/framework/objects.cc:298:9,
inlined from 'adbc::driver::Status
adbc::driver::{anonymous}::GetObjectsBuilder::Build()' at
c/driver/framework/objects.cc:274:5,
inlined from 'adbc::driver::Status
adbc::driver::BuildGetObjects(GetObjectsHelper*, GetObjectsDepth,
std::optional<std::basic_string_view<char> >,
std::optional<std::basic_string_view<char> >,
std::optional<std::basic_string_view<char> >,
std::optional<std::basic_string_view<char> >, const
std::vector<std::basic_string_view<char> >&, ArrowArrayStream*)' at
c/driver/framework/objects.cc:526:3:
D:/rtools45/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/14.3.0/include/c++/bits/stl_vector.h:372:49:
warning: '((std::_Vector_base<adbc::driver::GetObjectsHelper::ConstraintUsage,
std::allocator<adbc::driver::GetObjectsHelper::ConstraintUsage>
>::_Vector_impl_data*)((char*)&maybe_constraint +
offsetof(std::optional<adbc::driver::GetObjectsHelper::Constraint>,std::optional<adbc::driver::GetObjectsHelper::Constraint>::<unnamed>.std::_Optional_base<adbc::drive
[...]
372 | _M_impl._M_end_of_storage - _M_impl._M_start);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
c/driver/framework/objects.cc: In function 'adbc::driver::Status
adbc::driver::BuildGetObjects(GetObjectsHelper*, GetObjectsDepth,
std::optional<std::basic_string_view<char> >,
std::optional<std::basic_string_view<char> >,
std::optional<std::basic_string_view<char> >,
std::optional<std::basic_string_view<char> >, const
std::vector<std::basic_string_view<char> >&, ArrowArrayStream*)':
c/driver/framework/objects.cc:418:26: note:
'((std::_Vector_base<adbc::driver::GetObjectsHelper::ConstraintUsage,
std::allocator<adbc::driver::GetObjectsHelper::ConstraintUsage>
>::_Vector_impl_data*)((char*)&maybe_constraint +
offsetof(std::optional<adbc::driver::GetObjectsHelper::Constraint>,std::optional<adbc::driver::GetObjectsHelper::Constraint>::<unnamed>.std::_Optional_base<adbc::driver::GetObjectsHelper::Constraint,
false, false>::_M_payload.std::_Optional_payload<adbc::driver [...]
418 | UNWRAP_RESULT(auto maybe_constraint,
helper->NextConstraint());
| ^~~~~~~~~~~~~~~~
../src/c/driver/framework/status.h:265:3: note: in definition of macro
'UNWRAP_RESULT_IMPL'
265 | lhs = std::move((name).value());
| ^~~
c/driver/framework/objects.cc:418:7: note: in expansion of macro
'UNWRAP_RESULT'
418 | UNWRAP_RESULT(auto maybe_constraint,
helper->NextConstraint());
| ^~~~~~~~~~~~~
g++ -std=gnu++17 -I"D:/RCompile/recent/R/include" -DNDEBUG -I../src/c
-I../src/c/include -I../src/c/vendor/
-I../src/c/vendor/portable-snippets/include/ -I../src/c/vendor/fmt/include
-DADBC_EXPORT="" -D__USE_MINGW_ANSI_STDIO -DFMT_HEADER_ONLY=1
-I"d:/rtools45/x86_64-w64-mingw32.static.posix/include" -O2 -Wall
-mfpmath=sse -msse2 -mstackrealign -c c/driver/framework/utility.cc -o
c/driver/framework/utility.o
g++ -std=gnu++17 -I"D:/RCompile/recent/R/include" -DNDEBUG -I../src/c
-I../src/c/include -I../src/c/vendor/
-I../src/c/vendor/portable-snippets/include/ -I../src/c/vendor/fmt/include
-DADBC_EXPORT="" -D__USE_MINGW_ANSI_STDIO -DFMT_HEADER_ONLY=1
-I"d:/rtools45/x86_64-w64-mingw32.static.posix/include" -O2 -Wall
-mfpmath=sse -msse2 -mstackrealign -c c/driver/postgresql/connection.cc -o
c/driver/postgresql/connection.o
In file included from c/driver/postgresql/copy/../postgres_util.h:25,
from c/driver/postgresql/copy/reader.h:32,
from c/driver/postgresql/result_helper.h:32,
from c/driver/postgresql/connection.cc:43:
D:/rtools45/x86_64-w64-mingw32.static.posix/include/winsock2.h:15:2:
warning: #warning Please include winsock2.h before windows.h [-Wcpp]
15 | #warning Please include winsock2.h before windows.h
| ^~~~~~~
g++ -std=gnu++17 -I"D:/RCompile/recent/R/include" -DNDEBUG -I../src/c
-I../src/c/include -I../src/c/vendor/
-I../src/c/vendor/portable-snippets/include/ -I../src/c/vendor/fmt/include
-DADBC_EXPORT="" -D__USE_MINGW_ANSI_STDIO -DFMT_HEADER_ONLY=1
-I"d:/rtools45/x86_64-w64-mingw32.static.posix/include" -O2 -Wall
-mfpmath=sse -msse2 -mstackrealign -c c/driver/postgresql/database.cc -o
c/driver/postgresql/database.o
In file included from c/driver/postgresql/copy/../postgres_util.h:25,
from c/driver/postgresql/copy/reader.h:32,
from c/driver/postgresql/result_helper.h:32,
from c/driver/postgresql/database.cc:34:
D:/rtools45/x86_64-w64-mingw32.static.posix/include/winsock2.h:15:2:
warning: #warning Please include winsock2.h before windows.h [-Wcpp]
15 | #warning Please include winsock2.h before windows.h
| ^~~~~~~
g++ -std=gnu++17 -I"D:/RCompile/recent/R/include" -DNDEBUG -I../src/c
-I../src/c/include -I../src/c/vendor/
-I../src/c/vendor/portable-snippets/include/ -I../src/c/vendor/fmt/include
-DADBC_EXPORT="" -D__USE_MINGW_ANSI_STDIO -DFMT_HEADER_ONLY=1
-I"d:/rtools45/x86_64-w64-mingw32.static.posix/include" -O2 -Wall
-mfpmath=sse -msse2 -mstackrealign -c c/driver/postgresql/error.cc -o
c/driver/postgresql/error.o
g++ -std=gnu++17 -I"D:/RCompile/recent/R/include" -DNDEBUG -I../src/c
-I../src/c/include -I../src/c/vendor/
-I../src/c/vendor/portable-snippets/include/ -I../src/c/vendor/fmt/include
-DADBC_EXPORT="" -D__USE_MINGW_ANSI_STDIO -DFMT_HEADER_ONLY=1
-I"d:/rtools45/x86_64-w64-mingw32.static.posix/include" -O2 -Wall
-mfpmath=sse -msse2 -mstackrealign -c c/driver/postgresql/postgresql.cc -o
c/driver/postgresql/postgresql.o
In file included from c/driver/postgresql/copy/../postgres_util.h:25,
from c/driver/postgresql/copy/reader.h:32,
from c/driver/postgresql/statement.h:29,
from c/driver/postgresql/postgresql.cc:29:
D:/rtools45/x86_64-w64-mingw32.static.posix/include/winsock2.h:15:2:
warning: #warning Please include winsock2.h before windows.h [-Wcpp]
15 | #warning Please include winsock2.h before windows.h
| ^~~~~~~
g++ -std=gnu++17 -I"D:/RCompile/recent/R/include" -DNDEBUG -I../src/c
-I../src/c/include -I../src/c/vendor/
-I../src/c/vendor/portable-snippets/include/ -I../src/c/vendor/fmt/include
-DADBC_EXPORT="" -D__USE_MINGW_ANSI_STDIO -DFMT_HEADER_ONLY=1
-I"d:/rtools45/x86_64-w64-mingw32.static.posix/include" -O2 -Wall
-mfpmath=sse -msse2 -mstackrealign -c c/driver/postgresql/result_helper.cc
-o c/driver/postgresql/result_helper.o
In file included from c/driver/postgresql/copy/../postgres_util.h:25,
from c/driver/postgresql/copy/reader.h:32,
from c/driver/postgresql/result_helper.h:32,
from c/driver/postgresql/result_helper.cc:18:
D:/rtools45/x86_64-w64-mingw32.static.posix/include/winsock2.h:15:2:
warning: #warning Please include winsock2.h before windows.h [-Wcpp]
15 | #warning Please include winsock2.h before windows.h
| ^~~~~~~
g++ -std=gnu++17 -I"D:/RCompile/recent/R/include" -DNDEBUG -I../src/c
-I../src/c/include -I../src/c/vendor/
-I../src/c/vendor/portable-snippets/include/ -I../src/c/vendor/fmt/include
-DADBC_EXPORT="" -D__USE_MINGW_ANSI_STDIO -DFMT_HEADER_ONLY=1
-I"d:/rtools45/x86_64-w64-mingw32.static.posix/include" -O2 -Wall
-mfpmath=sse -msse2 -mstackrealign -c c/driver/postgresql/result_reader.cc
-o c/driver/postgresql/result_reader.o
g++ -std=gnu++17 -I"D:/RCompile/recent/R/include" -DNDEBUG -I../src/c
-I../src/c/include -I../src/c/vendor/
-I../src/c/vendor/portable-snippets/include/ -I../src/c/vendor/fmt/include
-DADBC_EXPORT="" -D__USE_MINGW_ANSI_STDIO -DFMT_HEADER_ONLY=1
-I"d:/rtools45/x86_64-w64-mingw32.static.posix/include" -O2 -Wall
-mfpmath=sse -msse2 -mstackrealign -c c/driver/postgresql/statement.cc -o
c/driver/postgresql/statement.o
In file included from c/driver/postgresql/copy/../postgres_util.h:25,
from c/driver/postgresql/copy/reader.h:32,
from c/driver/postgresql/statement.h:29,
from c/driver/postgresql/statement.cc:21:
D:/rtools45/x86_64-w64-mingw32.static.posix/include/winsock2.h:15:2:
warning: #warning Please include winsock2.h before windows.h [-Wcpp]
15 | #warning Please include winsock2.h before windows.h
| ^~~~~~~
gcc -I"D:/RCompile/recent/R/include" -DNDEBUG -I../src/c
-I../src/c/include -I../src/c/vendor/
-I../src/c/vendor/portable-snippets/include/ -I../src/c/vendor/fmt/include
-DADBC_EXPORT="" -D__USE_MINGW_ANSI_STDIO -DFMT_HEADER_ONLY=1
-I"d:/rtools45/x86_64-w64-mingw32.static.posix/include" -pedantic
-Wstrict-prototypes -O2 -Wall -std=gnu2x -mfpmath=sse -msse2 -mstackrealign
-c c/vendor/nanoarrow/nanoarrow.c -o c/vendor/nanoarrow/nanoarrow.o
g++ -shared -s -static-libgcc -o adbcpostgresql.dll tmp.def init.o
c/driver/common/utils.o c/driver/framework/objects.o
c/driver/framework/utility.o c/driver/postgresql/connection.o
c/driver/postgresql/database.o c/driver/postgresql/error.o
c/driver/postgresql/postgresql.o c/driver/postgresql/result_helper.o
c/driver/postgresql/result_reader.o c/driver/postgresql/statement.o
c/vendor/nanoarrow/nanoarrow.o -lpq -lpgcommon -lpgport -lssl -lcrypto -lz
-lsecur32 -lws2_32 -lwldap32 -lcrypt [...]
installing to
d:/RCompile/CRANguest/R-devel/lib/00LOCK-adbcpostgresql/00new/adbcpostgresql/libs/x64
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation
path
* MD5 sums
packaged installation of 'adbcpostgresql' as adbcpostgresql_0.22.0.zip
* DONE (adbcpostgresql)
```
</details>
I think on msys2 one of the system headers includes `windows.h`, so our
use of `winsock2.h` in `postgres_utils.h` causes the warning. I'm not
sure if this is a particularly clean solution (we could also just inline
byte swapping on Windows instead of using the helpers in winsock2).
---
c/driver/postgresql/connection.cc | 5 +++++
c/driver/postgresql/database.cc | 5 +++++
c/driver/postgresql/postgresql.cc | 5 +++++
c/driver/postgresql/result_helper.cc | 5 +++++
c/driver/postgresql/result_reader.cc | 5 +++++
c/driver/postgresql/statement.cc | 5 +++++
r/adbcsqlite/.Rbuildignore | 1 +
r/adbcsqlite/.gitignore | 1 +
8 files changed, 32 insertions(+)
diff --git a/c/driver/postgresql/connection.cc
b/c/driver/postgresql/connection.cc
index 7738a44fa..da7fdeac9 100644
--- a/c/driver/postgresql/connection.cc
+++ b/c/driver/postgresql/connection.cc
@@ -15,6 +15,11 @@
// specific language governing permissions and limitations
// under the License.
+// For #warning Please include winsock2.h before windows.h on RTools/msys2
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
#include "connection.h"
#include <array>
diff --git a/c/driver/postgresql/database.cc b/c/driver/postgresql/database.cc
index cecf7a6eb..bf488067c 100644
--- a/c/driver/postgresql/database.cc
+++ b/c/driver/postgresql/database.cc
@@ -15,6 +15,11 @@
// specific language governing permissions and limitations
// under the License.
+// For #warning Please include winsock2.h before windows.h on RTools/msys2
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
#include "database.h"
#include <array>
diff --git a/c/driver/postgresql/postgresql.cc
b/c/driver/postgresql/postgresql.cc
index 858c74378..16645d067 100644
--- a/c/driver/postgresql/postgresql.cc
+++ b/c/driver/postgresql/postgresql.cc
@@ -17,6 +17,11 @@
// A libpq-based PostgreSQL driver for ADBC.
+// For #warning Please include winsock2.h before windows.h on RTools/msys2
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
#include <cstring>
#include <memory>
diff --git a/c/driver/postgresql/result_helper.cc
b/c/driver/postgresql/result_helper.cc
index e87ee3735..e455467bd 100644
--- a/c/driver/postgresql/result_helper.cc
+++ b/c/driver/postgresql/result_helper.cc
@@ -15,6 +15,11 @@
// specific language governing permissions and limitations
// under the License.
+// For #warning Please include winsock2.h before windows.h on RTools/msys2
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
#include "result_helper.h"
#include <charconv>
diff --git a/c/driver/postgresql/result_reader.cc
b/c/driver/postgresql/result_reader.cc
index 61d17bb03..ad73d884a 100644
--- a/c/driver/postgresql/result_reader.cc
+++ b/c/driver/postgresql/result_reader.cc
@@ -15,6 +15,11 @@
// specific language governing permissions and limitations
// under the License.
+// For #warning Please include winsock2.h before windows.h on RTools/msys2
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
#include "result_reader.h"
#include <memory>
diff --git a/c/driver/postgresql/statement.cc b/c/driver/postgresql/statement.cc
index 0dec60452..d1aefc4d0 100644
--- a/c/driver/postgresql/statement.cc
+++ b/c/driver/postgresql/statement.cc
@@ -18,6 +18,11 @@
// Windows
#define NOMINMAX
+// For #warning Please include winsock2.h before windows.h on RTools/msys2
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
#include "statement.h"
#include <algorithm>
diff --git a/r/adbcsqlite/.Rbuildignore b/r/adbcsqlite/.Rbuildignore
index 42642862d..a871edffa 100644
--- a/r/adbcsqlite/.Rbuildignore
+++ b/r/adbcsqlite/.Rbuildignore
@@ -11,3 +11,4 @@
^cran-comments\.md$
^compile_commands\.json$
^\.cache$
+^CRAN-SUBMISSION$
diff --git a/r/adbcsqlite/.gitignore b/r/adbcsqlite/.gitignore
index 0e0fe4a7c..cb14b9d05 100644
--- a/r/adbcsqlite/.gitignore
+++ b/r/adbcsqlite/.gitignore
@@ -17,3 +17,4 @@
.Rproj.user
docs
+CRAN-SUBMISSION