Issue Details (XML | Word | Printable)

Key: CORE-5120
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Vlad Khorsun
Reporter: David Ostrovsky
Votes: 1
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Configure: snprintf function is already defined on MSVC 2015

Created: 29/Feb/16 07:37 AM   Updated: 19/Feb/17 09:45 PM
Component/s: Build Issues / Porting
Affects Version/s: None
Fix Version/s: 2.5.7, 3.0.2

Environment: Windows

QA Status: Cannot be tested


 Description  « Hide
Trying to use firebird with MSVC 2015 currently failing because of broken discovery of snprintf and vsnprintf functions:

There is

{code}
  AC_CHECK_FUNCS(snprintf vsnprintf)
{code}

macro in configure.in, that gets expanded to: [1]. Apparently one include or something is missing there.
So that in the end the autoconfig.h tries to erroneously redefine already defined snprintf function: [2].

[1] http://paste.openstack.org/show/488502
[2] http://paste.openstack.org/show/488503


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vlad Khorsun added a comment - 29/Feb/16 08:56 AM
Windows build not used POSIX build scripts.
Explain, please, what are you trying to do ?

David Ostrovsky added a comment - 29/Feb/16 01:58 PM - edited
I'm trying to build Firebird that is integrated in LlibreOffice with MSVC 14.0.

As you may know, on Windows LibreOffice is built with Cygwin, and thus the whole POSIX build toolchain is available.

For some external projects (Firebird is one of them), home made gcc-wrapper is used, that overloads CXX definition with real MSVC compiler paths so that in the end MSVC is used.

With this approach regular POSIX build toolchain is used even for MSVC compiler and it works with MSVC 12.0 as expected: [1].

My task is to add support for MSVC 14.0 aka VS 2015 to LibreOffice. The only missing part is to support building Firebird in both 32bit and 64bit modes: [2].

[1] https://github.com/LibreOffice/core/blob/master/external/firebird/ExternalProject_firebird.mk#L39-L78
[2] https://gerrit.libreoffice.org/22757

Sean Leyne made changes - 29/Feb/16 03:48 PM
Field Original Value New Value
Description Trying to use firebird with MSVC 2015 currently failing because of
broken discovery of snprintf and vsnprintf functions:

There is

{code}
  AC_CHECK_FUNCS(snprintf vsnprintf)
{code}

macro in configure.in, that gets expanded to: [1]. Apparently one include or something is missing there.
So that in the end the autoconfig.h tries to erroneously redefine already defined snprintf function: [2].

[1] http://paste.openstack.org/show/488502
[2] http://paste.openstack.org/show/488503
Trying to use firebird with MSVC 2015 currently failing because of broken discovery of snprintf and vsnprintf functions:

There is

{code}
  AC_CHECK_FUNCS(snprintf vsnprintf)
{code}

macro in configure.in, that gets expanded to: [1]. Apparently one include or something is missing there.
So that in the end the autoconfig.h tries to erroneously redefine already defined snprintf function: [2].

[1] http://paste.openstack.org/show/488502
[2] http://paste.openstack.org/show/488503
David Ostrovsky added a comment - 01/Mar/16 10:57 PM
After fixing snprintf/vsnprintf issues, I'm running into new errors, that seem to be
C++11 user-defined literals specific (supported only by MSVC 2015): [1], [2].
Apparently nobody has ever tried to build Firebird on MSVC 14.0. The fix is
to add a space around the macro: [3]. There are *a lot* of places, that are affected
by this problem in the code base.

* [1] http://paste.openstack.org/show/488858
* [2] http://stackoverflow.com/questions/31738796/using-macro-with-string-fails-on-vc-2015
* [3] http://paste.openstack.org/show/488863

Egor Pugin added a comment - 01/Mar/16 11:12 PM
I tried to compile fb with MSVC2015.
After fixing macro issues, you'll see more errors and more serious. The list of errors is almost endless. (Of course no, but it's huge.)
There will be errors that can change the runtime behaviour. So, it's better to coordinate your efforts with FB devs and not do all yourself.

Vlad Khorsun made changes - 17/Mar/16 08:33 AM
Assignee Vlad Khorsun [ hvlad ]
Vlad Khorsun added a comment - 17/Mar/16 10:38 AM
I fixed issues with snprintf (in autoconfing_msvc.h) and user-defined literals.
Now i can build with VS 2015 (MSVC 14) with no error.
Confirm, please

Egor Pugin added a comment - 17/Mar/16 11:04 AM
Works flawlessly with cmake.

========== Build: 61 succeeded, 0 failed, 0 up-to-date, 2 skipped ==========

---
And just a quick note here regarding VS2015.
It shows some warnings during building. Some projects on the internet have zero-warning policy.
Maybe it can be applied to firebird too? Just in the beginning of the 4.0 road.
Projects know about "good" warnings and they turn them off completely. But any new warning introduced by new comiter will be threated as an error by compiler.

Probably this should be asked on ML, not here.

Popa Adrian Marius added a comment - 04/Nov/16 10:28 AM
this can be closed patch is applied to master , 3.0 branch and 2.5 :)

Sean Leyne made changes - 04/Nov/16 02:03 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 2.5.7 [ 10770 ]
Fix Version/s 3.0.2 [ 10785 ]
Resolution Fixed [ 1 ]
Pavel Zotov made changes - 19/Feb/17 09:45 PM
Status Resolved [ 5 ] Resolved [ 5 ]
QA Status No test Cannot be tested