Project

General

Profile

Issue #3352

custom printf specifiers on Windows

Added by Noel Kuntze 11 months ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
windows
Affected version:
5.8.2
Resolution:
No change required

Description

Currently, strongSwan built for Windows and run on Windows can not use custom specifiers. Thus the test code for the printf-hooks crashes on Windows.
mingw64 supports GNU style printf custom hooks and specifiers by using the USE_MINGW_ANSI_STDIO 1 macro and the _attribute((format (_MINGW_PRINTF_FORMAT, 2, 3))) macro.
We could make use of that to then also run the printf-hooks test and use the custom printf hooks on Windows.
Do the custom hooks work on Windows right now? Would this be of benefit?

History

#1 Updated by Noel Kuntze 11 months ago

I forgot, the link to the wiki page: https://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/

#2 Updated by Tobias Brunner 11 months ago

  • Status changed from New to Feedback

Currently, strongSwan built for Windows and run on Windows can not use custom specifiers.

What are you referring to? On Windows, or whenever else register_printf_specifier()/register_printf_function() are not available, the custom built-in printf implementation is used automatically (can also be selected manually if necessary via --with-printf-hooks=builtin).

Thus the test code for the printf-hooks crashes on Windows.

We run our tests successfully on Windows (via AppVeyor) automatically for every push.

mingw64 supports GNU style printf custom hooks and specifiers by using the USE_MINGW_ANSI_STDIO 1 macro and the _attribute((format (_MINGW_PRINTF_FORMAT, 2, 3))) macro.

That seems to be about interpreting existing GNU printf-specifiers. At least the documentation does not mention anything about custom printf-specifiers.

#3 Updated by Noel Kuntze 11 months ago

  • Status changed from Feedback to Closed

Tobias Brunner wrote:

Currently, strongSwan built for Windows and run on Windows can not use custom specifiers.

What are you referring to? On Windows, or whenever else register_printf_specifier()/register_printf_function() are not available, the custom built-in printf implementation is used automatically (can also be selected manually if necessary via --with-printf-hooks=builtin).

Thus the test code for the printf-hooks crashes on Windows.

We run our tests successfully on Windows (via AppVeyor) automatically for every push.

Interesting. I have failures (crashes) for that test on appveyor. It might not be related to the specific test then.

mingw64 supports GNU style printf custom hooks and specifiers by using the USE_MINGW_ANSI_STDIO 1 macro and the _attribute((format (_MINGW_PRINTF_FORMAT, 2, 3))) macro.

That seems to be about interpreting existing GNU printf-specifiers. At least the documentation does not mention anything about custom printf-specifiers.

Alright, thanks. :)

#4 Updated by Noel Kuntze 11 months ago

  • Resolution set to No change required

#5 Updated by Tobias Brunner 11 months ago

Interesting. I have failures (crashes) for that test on appveyor. It might not be related to the specific test then.

Yeah, we have occasional crashes too on AppVeyor (in different tests, so it's tricky to track down).

Also available in: Atom PDF