[Media_api] Some #pragmas for Windows

Peter Castine pcastine at gmx.net
Thu May 3 20:12:04 PDT 2007


Visual Studio just bunged up on me so I had to rebuild my project,  
which reminded me that the VC compiler spits a bunch of warnings at  
PortMIDI that are sort of superfluous.

C compiler warnings can (sometimes) point to logic problems in code,  
so I try to minimize the spurious ones. The VC warnings can be  
supressed as follows:

In pa_win_wmme.c and pmwinmm.c:

#ifdef _MSC_VER
  #pragma warning(disable: 4133)  // stop warnings about implicit  
typecasts
#endif

In portmidi.c:

#ifdef _MSC_VER
  #pragma warning(disable: 4244)  // stop warnings about downsize  
typecasts
  #pragma warning(disable: 4018)  // stop warnings about signed/ 
unsigned comparison
#endif


FWIW. I don't know how others feel about this. I also globally turn  
off C4068 warnings (unknown pragma), which the paranoid New Yorker in  
me views as a deliberate attempt by MS to discourage developers from  
writing cross-platform code.

-- P.


--------------    http://www.bek.no/~pcastine/Litter/    -------------
Peter Castine             +--> Litter Power & Litter Bundle for Jitter
                                Universal Binaries on the way
iCE:  Sequencing,  Recording &
       Interface  Building  for                   |home    | chez nous|
       Max/MSP   Extremely cool                   |bei uns |  i nostri|
       http://www.dspaudio.com/                   http://www.castine.de




More information about the media_api mailing list