Complier warnings on mingw gcc 4.5.0

Поиск
Список
Период
Сортировка
От Itagaki Takahiro
Тема Complier warnings on mingw gcc 4.5.0
Дата
Msg-id AANLkTimFz3iexamZvCSq=T2Cdw0V-ViAhk66MkQ7jV9Q@mail.gmail.com
обсуждение исходный текст
Ответы Re: Complier warnings on mingw gcc 4.5.0  (Hiroshi Inoue <inoue@tpf.co.jp>)
Re: Complier warnings on mingw gcc 4.5.0  (Itagaki Takahiro <itagaki.takahiro@gmail.com>)
Список pgsql-hackers
I compiled the source with mingw gcc 4.5.0, that has been released recently.
The compile was succeeded and worked well at least for simple queries,
but there were many warnings during the compile.
----
1. warning: '<symbol>' redeclared without dllimport attribute:
previous dllimport ignored
2. warning: unknown conversion type character 'm' in format
3. warning: unknown conversion type character 'l' in format
----

1 is easy to fix with the attached patch.
I wonder why mingw gcc < 4.5 can build codes without the fix...

For 2, we could remove __attribute__((format(printf))) on mingw, but
it also disables type checking for formatters. Are there better solutions?

I have not yet researched for 3, that might be most dangerous.

=# select version();                                    version
----------------------------------------------------------------------------------PostgreSQL 9.0.1 on i686-pc-mingw32,
compiledby GCC gcc.exe (GCC)
 
4.5.0, 32-bit
(1 row)

OS: Windows 7 64bit


diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index 988c1c9..31c877f 100644
*** a/src/include/port/win32.h
--- b/src/include/port/win32.h
***************
*** 58,64 **** #define PGDLLIMPORT __declspec (dllimport) #endif

! #ifdef _MSC_VER #define PGDLLEXPORT __declspec (dllexport) #else #define PGDLLEXPORT __declspec (dllimport)
--- 58,64 ---- #define PGDLLIMPORT __declspec (dllimport) #endif

! #if defined(_MSC_VER) || __GNUC__ >= 4 #define PGDLLEXPORT __declspec (dllexport) #else #define PGDLLEXPORT
__declspec(dllimport)
 

-- 
Itagaki Takahiro


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: SR fails to send existing WAL file after off-line copy
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: Tracking latest timeline in standby mode