Bug 691498

Summary: win32/win64 build warnings
Product: Ghostscript Reporter: Hin-Tak Leung <htl10>
Component: GeneralAssignee: Chris Liddell (chrisl) <chris.liddell>
Status: RESOLVED FIXED    
Severity: normal CC: christinedelight.top85, sags5495
Priority: P4    
Version: master   
Hardware: Other   
OS: Linux   
Customer: Word Size: ---
Attachments: MSVC win32 build log with vc 9

Description Hin-Tak Leung 2010-07-25 23:06:43 UTC
Created attachment 6550 [details]
MSVC  win32 build log with vc 9

The win32/win64 build don't have much warnings except the usual pointer casts which are filtered out from below. I think all of these base\gsicc_create.c base\sidscale.c are in Michael's area:

----------------
.\base\gsicc_create.c(884) : warning C4305: 'function' : truncation from 'double' to 'float'
.\base\gsicc_create.c(886) : warning C4305: 'function' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1042) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1042) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1042) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1043) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1043) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1043) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1044) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1044) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1044) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1045) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1045) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1045) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1046) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1046) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1046) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1047) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1047) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1047) : warning C4305: 'initializing' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1677) : warning C4305: '=' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1679) : warning C4305: '=' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1714) : warning C4305: '=' : truncation from 'double' to 'float'
.\base\gsicc_create.c(1716) : warning C4305: '=' : truncation from 'double' to 'float'
.\base\sidscale.c(175) : warning C4244: '=' : conversion from 'float' to 'bits16', possible loss of data
-----------------------

These linker warnings are only seem on win64 builds:

-------------
gsdll.obj : warning LNK4197: export 'gsdll_execute_begin' specified multiple times; using first specification
gsdll.obj : warning LNK4197: export 'gsdll_execute_cont' specified multiple times; using first specification
gsdll.obj : warning LNK4197: export 'gsdll_execute_end' specified multiple times; using first specification
gsdll.obj : warning LNK4197: export 'gsdll_exit' specified multiple times; using first specification
gsdll.obj : warning LNK4197: export 'gsdll_revision' specified multiple times; using first specification
gsdll.obj : warning LNK4197: export 'gsdll_init' specified multiple times; using first specification
gp_msdll.obj : warning LNK4197: export 'DllEntryPoint' specified multiple times; using first specification
gp_msdll.obj : warning LNK4197: export 'DllMain' specified multiple times; using first specification
iapi.obj : warning LNK4197: export 'gsapi_revision' specified multiple times; using first specification
iapi.obj : warning LNK4197: export 'gsapi_new_instance' specified multiple times; using first specification
iapi.obj : warning LNK4197: export 'gsapi_delete_instance' specified multiple times; using first specification
iapi.obj : warning LNK4197: export 'gsapi_set_stdio' specified multiple times; using first specification
iapi.obj : warning LNK4197: export 'gsapi_set_poll' specified multiple times; using first specification
iapi.obj : warning LNK4197: export 'gsapi_set_display_callback' specified multiple times; using first specification
iapi.obj : warning LNK4197: export 'gsapi_init_with_args' specified multiple times; using first specification
iapi.obj : warning LNK4197: export 'gsapi_run_string_begin' specified multiple times; using first specification
iapi.obj : warning LNK4197: export 'gsapi_run_string_continue' specified multiple times; using first specification
iapi.obj : warning LNK4197: export 'gsapi_run_string_end' specified multiple times; using first specification
iapi.obj : warning LNK4197: export 'gsapi_run_string_with_length' specified multiple times; using first specification
iapi.obj : warning LNK4197: export 'gsapi_run_string' specified multiple times; using first specification
iapi.obj : warning LNK4197: export 'gsapi_run_file' specified multiple times; using first specification
iapi.obj : warning LNK4197: export 'gsapi_exit' specified multiple times; using first specification
iapi.obj : warning LNK4197: export 'gsapi_set_visual_tracer' specified multiple times; using first specification
gdevwdib.obj : warning LNK4197: export 'gsdll_copy_palette' specified multiple times; using first specification
gdevwdib.obj : warning LNK4197: export 'gsdll_lock_device' specified multiple times; using first specification
gdevwdib.obj : warning LNK4197: export 'gsdll_get_bitmap_row' specified multiple times; using first specification
gdevwdib.obj : warning LNK4197: export 'gsdll_copy_dib' specified multiple times; using first specification
gdevwdib.obj : warning LNK4197: export 'gsdll_draw' specified multiple times; using first specification
------------------------

I am not going to attach the win64 logs, since it is a bit tricky and also does not differ from the win32 build log except for the linker warning messages.
Comment 1 SaGS 2010-07-26 05:35:19 UTC
I also get a harmful warning from VS2003 (7.1):

    gdevbbox.c(1197) : warning C4700: local variable 'cdev' used without 
    having been initialized

Note there are 2 variables named ‘cdev’ there:

  - a local one declared, without being initialized, in line 1194;
  - the function’s last parameter, which is never used because it is 
    hidden be the local one.

Maybe some of the references to ‘cdev’ should be to the parameter (in 
particular the last parameter of the ‘*dev_proc(.., create_compositor)()’ 
call, signaled by the error message?), and others to the local variable. 
As I don’t know the code, I cannot suggest a fix.
Comment 2 Hin-Tak Leung 2010-07-26 05:43:54 UTC
(In reply to comment #1)
> I also get a harmful warning from VS2003 (7.1):
> 
>     gdevbbox.c(1197) : warning C4700: local variable 'cdev' used without 
>     having been initialized
> 
> Note there are 2 variables named ‘cdev’ there:
> 
>   - a local one declared, without being initialized, in line 1194;
>   - the function’s last parameter, which is never used because it is 
>     hidden be the local one.
> 
> Maybe some of the references to ‘cdev’ should be to the parameter (in 
> particular the last parameter of the ‘*dev_proc(.., create_compositor)()’ 
> call, signaled by the error message?), and others to the local variable. 
> As I don’t know the code, I cannot suggest a fix.

I am glad this warning shows up in windows build as well (was wondering about it).
This warning already dealt with in a patch I had while doing this build:

http://bugs.ghostscript.com/show_bug.cgi?id=691463#c5

Somebody else needs to commit that fix.
Comment 3 Marcos H. Woehrmann 2010-07-29 18:08:05 UTC
Please re-assign to support after the .\base\gsicc_create warnings are dealt with.
Comment 4 Michael Vrhel 2010-07-30 14:00:31 UTC
Fixed gsicc_create.c warnings in rev 11569
Comment 5 Michael Vrhel 2010-07-30 14:04:06 UTC
Reassigning to support as mentioned in comment 3.
Comment 6 Ray Johnston 2010-07-30 15:41:03 UTC
Till committed Hin-Tak's patch mentioned in comment #2 as rev 11568.

The last thing to look at are the linker messages.
Comment 7 Chris Liddell (chrisl) 2013-11-11 08:26:09 UTC
win64 warnings fixed in:

http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=efc0ab29