warnings during build with VS2008

Bug #786156 reported by Alexander Belchenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
subvertpy
Fix Released
Low
Jelmer Vernooij

Bug Description

Unknown pragma directive warnings:

c:\work\bazaar\zzz\subvertpy\subvertpy\editor.h(23) : warning C4068: неизвестная директива pragma
c:\work\bazaar\zzz\subvertpy\subvertpy\editor.h(42) : warning C4068: неизвестная директива pragma
c:\work\bazaar\zzz\subvertpy\subvertpy\util.h(40) : warning C4068: неизвестная директива pragma
c:\work\bazaar\zzz\subvertpy\subvertpy\util.h(98) : warning C4068: неизвестная директива pragma

util.h(40) is #pragma GCC visibility push(hidden)
util.h(98) is #pragma GCC visibility pop

As I understand both of those pragmas are only for gcc, so you'd better wrap them into the following check:

#ifndef _MSC_VER
#pragma GCC ...
#endif

The same for editor.h.

Also there are warnings about type conversions, perhaps implicit conversions, and possible loss of data:

subvertpy\util.c(635) : warning C4244: функция: преобразование 'const svn_filesize_t' в 'long', возможна потеря данных
subvertpy\util.c(650) : warning C4244: функция: преобразование 'const apr_time_t' в 'long', возможна потеря данных

subvertpy\repos.c(688) : warning C4244: функция: преобразование 'svn_filesize_t' в 'long', возможна потеря данных

You may want to check that and maybe provide and explicit cast.

Related branches

Revision history for this message
Alexander Belchenko (bialix) wrote :

Windows, Python 2.6, VS2008Express.

Revision history for this message
Alexander Belchenko (bialix) wrote :

So, I think warning about conversion from svn_filesize_t to long is the real bug report actually, because svn_filesize_t defined as 64-bit int, and long is 32 bit value.

The same for apr_time_t -- it's also defined as 64-bit value.

By "defined" I mean their types from svn-1.6.6 headers.

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 786156] [NEW] warnings during build with VS2008

Hi Alexander,

On Sat, 2011-05-21 at 12:42 +0000, Alexander Belchenko wrote:
> Unknown pragma directive warnings:
>
> c:\work\bazaar\zzz\subvertpy\subvertpy\editor.h(23) : warning C4068: неизвестная директива pragma
> c:\work\bazaar\zzz\subvertpy\subvertpy\editor.h(42) : warning C4068: неизвестная директива pragma
> c:\work\bazaar\zzz\subvertpy\subvertpy\util.h(40) : warning C4068: неизвестная директива pragma
> c:\work\bazaar\zzz\subvertpy\subvertpy\util.h(98) : warning C4068: неизвестная директива pragma
>
> util.h(40) is #pragma GCC visibility push(hidden)
> util.h(98) is #pragma GCC visibility pop
>
> As I understand both of those pragmas are only for gcc, so you'd better
> wrap them into the following check:
>
> #ifndef _MSC_VER
> #pragma GCC ...
> #endif
I'm happy for these to be warnings, and I think they *should* warnings
on systems where we can't hide those symbols until we find an
alternative solution.

> The same for editor.h.
>
> Also there are warnings about type conversions, perhaps implicit
> conversions, and possible loss of data:
>
> subvertpy\util.c(635) : warning C4244: функция: преобразование 'const svn_filesize_t' в 'long', возможна потеря данных
> subvertpy\util.c(650) : warning C4244: функция: преобразование 'const apr_time_t' в 'long', возможна потеря данных
>
> subvertpy\repos.c(688) : warning C4244: функция: преобразование
> 'svn_filesize_t' в 'long', возможна потеря данных
>
> You may want to check that and maybe provide and explicit cast.
I don't speak Russian very well, and I don't have MSVC here. Can you
parahprase what the errors are about?

Cheers,

Jelmer

Revision history for this message
Alexander Belchenko (bialix) wrote :

21.05.2011 19:40, Jelmer Vernooij пишет:
>> #ifndef _MSC_VER
>> #pragma GCC ...
>> #endif

> I'm happy for these to be warnings, and I think they *should* warnings
> on systems where we can't hide those symbols until we find an
> alternative solution.

Jelmer, MSVC *by default* hides symbols and don't export them from
dll. That was always my frustration with GCC that it by default export
everything from shared libraries. Thank you for pointing me to the
appropriate pragmas, I'll use it in my code now.

But I think my patch is correct, see
http://gcc.gnu.org/wiki/Visibility and section about Windows
compatibiltiy.

>> Also there are warnings about type conversions, perhaps implicit
>> conversions, and possible loss of data:
>>
>> subvertpy\util.c(635) : warning C4244: функция: преобразование 'const svn_filesize_t' в 'long', возможна потеря данных
>> subvertpy\util.c(650) : warning C4244: функция: преобразование 'const apr_time_t' в 'long', возможна потеря данных
>>
>> subvertpy\repos.c(688) : warning C4244: функция: преобразование
>> 'svn_filesize_t' в 'long', возможна потеря данных
>>
>> You may want to check that and maybe provide and explicit cast.
> I don't speak Russian very well, and I don't have MSVC here. Can you
> parahprase what the errors are about?

http://msdn.microsoft.com/en-us/library/th7a07tz(v=vs.80).aspx

I'm sorry about Russian warnings, I'm going to uninstall Russian
MSVC2008 and install English one instead.

--
All the dude wanted was his rug back

Revision history for this message
Alexander Belchenko (bialix) wrote :

22.05.2011 9:35, Alexander Belchenko пишет:
> 21.05.2011 19:40, Jelmer Vernooij пишет:
>>> Also there are warnings about type conversions, perhaps implicit
>>> conversions, and possible loss of data:
>>>
>>> subvertpy\util.c(635) : warning C4244: функция: преобразование 'const svn_filesize_t' в 'long', возможна потеря данных
>>> subvertpy\util.c(650) : warning C4244: функция: преобразование 'const apr_time_t' в 'long', возможна потеря данных
>>>
>>> subvertpy\repos.c(688) : warning C4244: функция: преобразование
>>> 'svn_filesize_t' в 'long', возможна потеря данных
>>>
>>> You may want to check that and maybe provide and explicit cast.
>> I don't speak Russian very well, and I don't have MSVC here. Can you
>> parahprase what the errors are about?
>
> http://msdn.microsoft.com/en-us/library/th7a07tz(v=vs.80).aspx

Actually in English those errors sounds like:

conversion from 'const svn_filesize_t' to 'long', possible loss of data
conversion from 'const apr_time_t' to 'long', possible loss of data

Both svn_filesize_t and apr_time_t are __int64, i.e. `long long`.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Sorry, you're right - I was confused about the fact that we didn't have to explicitly export anything elsewhere, but of course we're not actually exporting any C functions.

Fixed (the two warnings in util.c too), though in a slightly different manner that doesn't is specific to the compiler rather than the platform.

Changed in subvertpy:
status: New → Fix Committed
importance: Undecided → Low
assignee: nobody → Jelmer Vernooij (jelmer)
milestone: none → 0.8.1
Jelmer Vernooij (jelmer)
Changed in subvertpy:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.