* the rationale for redefining integral types?
@ 2005-08-03 11:53 Robert P. J. Day
2005-08-03 12:04 ` Steve Graegert
0 siblings, 1 reply; 3+ messages in thread
From: Robert P. J. Day @ 2005-08-03 11:53 UTC (permalink / raw)
To: C programming list
(i apologize if i asked this before once upon a time, i'm sort of
immersed in digging through some legacy code and it's all starting to
merge together.)
in this legacy code, one of the previous authors took it upon
himself to redefine some of the basic integral types, such as int8,
int16, int32 ... that sort of thing.
there doesn't appear to be any benefit to these internally redefined
types over the ones in the standard library, so i can't see why it
would have been done.
is there some reason a programmer might want to do this?
rday
p.s. and, no, there doesn't appear to be anything subtlely clever
about the redefinitions. just plain int and unsigned int of length 8
bits, 16 bits, ... etc.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: the rationale for redefining integral types?
2005-08-03 11:53 the rationale for redefining integral types? Robert P. J. Day
@ 2005-08-03 12:04 ` Steve Graegert
2005-08-03 12:14 ` Robert P. J. Day
0 siblings, 1 reply; 3+ messages in thread
From: Steve Graegert @ 2005-08-03 12:04 UTC (permalink / raw)
To: Robert P. J. Day; +Cc: C programming list
On 8/3/05, Robert P. J. Day <rpjday@mindspring.com> wrote:
>
> (i apologize if i asked this before once upon a time, i'm sort of
> immersed in digging through some legacy code and it's all starting to
> merge together.)
It's OK. You're welcome.
> in this legacy code, one of the previous authors took it upon
> himself to redefine some of the basic integral types, such as int8,
> int16, int32 ... that sort of thing.
Sounds weird, indeed, but I suspect the code to be pre-POSIX (before 1989).
> there doesn't appear to be any benefit to these internally redefined
> types over the ones in the standard library, so i can't see why it
> would have been done.
The only reason I could think of is that the developer wanted to
introduce some kind of portability by masking underlying types (and
probably their size) transparently. Is this particular piece of code
part of a library? Do the headers contain some #ifdefs to allow
conditional compilation for certain systems?
Regards
\Steve
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: the rationale for redefining integral types?
2005-08-03 12:04 ` Steve Graegert
@ 2005-08-03 12:14 ` Robert P. J. Day
0 siblings, 0 replies; 3+ messages in thread
From: Robert P. J. Day @ 2005-08-03 12:14 UTC (permalink / raw)
To: Steve Graegert; +Cc: C programming list
On Wed, 3 Aug 2005, Steve Graegert wrote:
> On 8/3/05, Robert P. J. Day <rpjday@mindspring.com> wrote:
> > in this legacy code, one of the previous authors took it upon
> > himself to redefine some of the basic integral types, such as
> > int8, int16, int32 ... that sort of thing.
>
> Sounds weird, indeed, but I suspect the code to be pre-POSIX (before
> 1989).
nope, the code is at most 4 years old.
> > there doesn't appear to be any benefit to these internally
> > redefined types over the ones in the standard library, so i can't
> > see why it would have been done.
>
> The only reason I could think of is that the developer wanted to
> introduce some kind of portability by masking underlying types (and
> probably their size) transparently. Is this particular piece of
> code part of a library? Do the headers contain some #ifdefs to
> allow conditional compilation for certain systems?
nope and nope. i'm just going to assume i can replace it with
standard C types. if something breaks, well, then i'll have my
answer, i guess. thanks.
rday
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-08-03 12:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-03 11:53 the rationale for redefining integral types? Robert P. J. Day
2005-08-03 12:04 ` Steve Graegert
2005-08-03 12:14 ` Robert P. J. Day
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).