473,395 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Re: reporting typedef errors automatically

On Thu, May 29, 2008 at 02:04:16PM -0700, vi******@gmail.com wrote:
If intN_t types are available, they are two's complement no padding
signed integers with exact width N.
Reference, 7.18.1.1 Exact-width integer types.
These tests are not needed.
That's strange. 7.18.1.1 says

1 The typedef name intN_t designates a signed integer type with width N, no
padding bits, and a two's complement representation. Thus, int8_t denotes a
signed integer type with a width of exactly 8 bits.

and also:

3 These types are optional. However, if an implementation provides integer
types with widths of 8, 16, 32, or 64 bits, it shall define the corresponding
typedef names.

Does that imply that if an implementation provides 32 or 16-bit int with
one's complement representation, that it has to define int32_t, which has,
in turn, two's component representation.
Szabolcs

Jun 27 '08 #1
1 2341
On Thu, 29 May 2008 21:28:00 +0000, Szabolcs Borsanyi wrote:
That's strange. 7.18.1.1 says

1 The typedef name intN_t designates a signed integer type with width N,
no padding bits, and a two's complement representation. Thus, int8_t
denotes a signed integer type with a width of exactly 8 bits.

and also:

3 These types are optional. However, if an implementation provides
integer types with widths of 8, 16, 32, or 64 bits, it shall define the
corresponding typedef names.

Does that imply that if an implementation provides 32 or 16-bit int with
one's complement representation, that it has to define int32_t, which
has, in turn, two's component representation.
You are correct, and the text has already been changed to

3 These types are optional. However, if an implementation provides integer
types with widths of 8, 16, 32, or 64 bits, no padding bits, and (for the
signed types) that have a two's complement representation, it shall define
the corresponding typedef names.

in an attempt to address precisely that issue. It doesn't manage to do so
entirely, though: if an implementation provides a 32-bit ones' complement
signed int, and a 32-bit unsigned int, both without padding bits, then
7.18.1.1p3 requires that the implementation define uint32_t, and 7.18.1p1
states that if an implementation provides uint32_t, it must also provide
int32_t.
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Oliver Spiesshofer | last post by:
Hi, I have set in my .htaccess file php_flag error_reporting 2047 to prevent error output to users. However, in some selected scripts I want to allow errors to be shown. I tried several...
5
by: steve | last post by:
Hi, In my script (phpnuke), whenever there is access to database, there is this line of code: message_die(GENERAL_ERROR, ’some error msg’, ’’, __LINE__, __FILE__, $sql); Is there a more...
2
by: Patrick Kowalzick | last post by:
Hello NG, sorry to bother again, but I am a lit surprised that I got no answer on my post (attached below). So I refined the code a little bit :-). If there is a typedefed class X inside a...
12
by: vvv | last post by:
Hi All, Do we have anything in .NET which is equivalent to C++'s Typedef . Regards, Vasanth
2
by: Brendan Reynolds | last post by:
When I run FxCop on an ASP.NET app that has a reference to the reporting services web reference, I get a very long list of 'errors' that are not in my code, but in the web service. As there isn't...
6
by: Alex | last post by:
Hello people, I am getting errors from VS2003 when working with typedef'ed types. For example, assume that I have a type T, defined in a 3rd party include file based on some condition #if...
8
by: Ronny Mandal | last post by:
Consider these two: Typedef struct { int foo, bar } FooBar; struct FooBar { int foo, bar }; What woul be the only difference here; just that I can create new instances by 'Foobar fb, *pfb',...
5
by: Paul Furman | last post by:
What is the proper way to turn off error reporting? I'm on a shared server so... "Note: Although display_errors may be set at runtime (with ini_set ()), it won't have any affect if the script...
1
by: Melissa Nava | last post by:
Have an online system. Currently the error reporting either does: A) logs to a file, B) databases errors or C) emails individual errors. Also have phone notifications for systematically calling the...
3
by: Roman Mashak | last post by:
Hello, Jack! You wrote on Thu, 29 May 2008 20:38:35 -0500: JKThis is a pretty stupid idea, and extremely non-portable. Who's JKnot-so-bright idea is it?...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.