ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] OS X and Win32 buildbots unhappy with mpeg.c

From: "Maynard, Chris" <Christopher.Maynard@xxxxxxxxx>
Date: Tue, 21 Aug 2007 23:34:14 -0400
There is still a problem compiling packet-mpeg-pes.c.
- Chris
P.S. Here's the relevant output (at revision 22580):
 
packet-mpeg-pes-template.c(138) : error C2220: warning treated as error - no obj
ect file generated
packet-mpeg-pes-template.c(138) : warning C4244: 'initializing' : conversion fro
m 'unsigned __int64 ' to 'unsigned int ', possible loss of data
packet-mpeg-pes-template.c(139) : warning C4244: '=' : conversion from 'unsigned
 __int64 ' to 'long ', possible loss of data
packet-mpeg-pes-template.c(140) : error C2059: syntax error : 'bad suffix on num
ber'
packet-mpeg-pes-template.c(140) : error C2146: syntax error : missing ';' before
 identifier 'L'
packet-mpeg-pes-template.c(140) : error C2065: 'L' : undeclared identifier
packet-mpeg-pes-template.c(140) : warning C4552: '/' : operator has no effect; e
xpected operator with side-effect
packet-mpeg-pes-template.c(154) : warning C4244: 'initializing' : conversion fro
m 'unsigned __int64 ' to 'unsigned int ', possible loss of data
packet-mpeg-pes-template.c(156) : warning C4244: 'initializing' : conversion fro
m 'unsigned __int64 ' to 'unsigned int ', possible loss of data
packet-mpeg-pes-template.c(157) : warning C4244: '=' : conversion from 'unsigned
 __int64 ' to 'long ', possible loss of data
packet-mpeg-pes-template.c(158) : error C2059: syntax error : 'bad suffix on num
ber'
packet-mpeg-pes-template.c(158) : error C2146: syntax error : missing ';' before
 identifier 'L'
packet-mpeg-pes-template.c(158) : warning C4552: '/' : operator has no effect; e
xpected operator with side-effect
Generating Code...
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\VC98\Bin\N
MAKE.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\VC98\Bin\N
MAKE.EXE"' : return code '0x2'
Stop.

________________________________

From: wireshark-dev-bounces@xxxxxxxxxxxxx on behalf of Guy Harris
Sent: Tue 8/21/2007 11:01 PM
To: Developer support list for Wireshark
Subject: Re: [Wireshark-dev] OS X and Win32 buildbots unhappy with mpeg.c



I've checked in a change that should fix this.

A couple of rules for developers:

        1) If you're doing 64-bit arithmetic, and assigning the result to a 
32-bit quantity:

                1) make sure that either the result will always fit in 32 bits, you 
check for results that don't fit and handle that case with the 
appropriate error handling, or you're willing to live with a bogus 
result if it doesn't fit;

                2) once you've done any checking for results that don't fit, if 
you're doing any, explicitly cast the result to the type of the item 
to which you're assigning it, so that the compiler knows you're aware 
of the issue and have done what you consider appropriate, and won't 
warn you about it.

        2) Do NOT create 64-bit integral constants by sticking "LL" at the 
end of the constant; MSVC++ 6.0, for example, doesn't recognize that.  
Instead, wrap the constant in G_GINT64_CONSTANT(), e.g. don't do 
"0x123456789abcLL", do "G_GINT64_CONSTANT(0x123456789abc)".

The latter of those is covered in the "Portability" section of doc/
README.developer; that section lists a number of rules for 
portability, many of which are there because of code submitted to 
Ethereal/Wireshark that, for example, "worked in GCC" but failed in 
other compilers.

The former of those arguably should be covered in doc/README.developer 
as well.
_______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
http://www.wireshark.org/mailman/listinfo/wireshark-dev





-----------------------------------------
This email may contain confidential and privileged material for the
sole use of the intended recipient(s). Any review, use, retention,
distribution or disclosure by others is strictly prohibited. If you
are not the intended recipient (or authorized to receive for the
recipient), please contact the sender by reply email and delete all
copies of this message. Also, email is susceptible to data
corruption, interception, tampering, unauthorized amendment and
viruses. We only send and receive emails on the basis that we are
not liable for any such corruption, interception, tampering,
amendment or viruses or any consequence thereof.

<<winmail.dat>>