Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure: snprintf function is already defined on MSVC 2015 [CORE5120] #5404

Closed
firebird-issue-importer opened this issue Feb 29, 2016 · 11 comments

Comments

@firebird-issue-importer

Submitted by: @davido

Votes: 1

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 http://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

Commits: 713b68c 3c80ce0 1abb10f 9ae426a

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 29, 2016

Commented by: @hvlad

Windows build not used POSIX build scripts.
Explain, please, what are you trying to do ?

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 29, 2016

Commented by: @davido

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 29, 2016

Modified by: Sean Leyne (seanleyne)

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 http://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 http://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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 2, 2016

Commented by: @davido

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 2, 2016

Commented by: @egorpugin

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.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 17, 2016

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 17, 2016

Commented by: @hvlad

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 17, 2016

Commented by: @egorpugin

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.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 4, 2016

Commented by: @mariuz

this can be closed patch is applied to master , 3.0 branch and 2.5 :)

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 4, 2016

Modified by: Sean Leyne (seanleyne)

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5.7 [ 10770 ]

Fix Version: 3.0.2 [ 10785 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 20, 2017

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Cannot be tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants