Re: unsigned int support
On Aug 7, 1:19 pm, Michael DOUBEZ <michael.dou...@free.fr> wrote:
faz a =E9crit :
I have tried this using VC++ 1998(older version)
int main()
{
long long bas;
return 0;
}
D:\Program Files\Microsoft Visual Studio\my projects\link list
\long.cpp(4) : error C2632: 'long' followed by 'long' is illegal
Error executing cl.exe.
long.obj - 1 error(s), 0 warning(s)
Not supported...I guess my compiler is 32-bit....Which compiler
support this??
long long was introduced in C99. It is not really a surprise a compiler
didn't know about it in 98.
Actually, it was introduced in one of the Unix standards long
before that. From what I understand, the ISO C committee didn't
particularly like it; what do you write in ten years time, for
128 bit ints: long long long? But even at the time the 1999
standard was being finalized (1997 or before), it was too
ubiquious to be ignored.
In the case of Visual Studios, of course, the Unix standards
aren't applicable, and VC++ actually did something more
intelligent, defining a type _int64 (which extends in a rather
obvious fashion, *and* is sort of in the implementation
namespace, although as a keyword, it really needs two
underscores). Also, compilers have a certain lead time as well,
and it wasn't at all clear that those opposing long long in C99
wouldn't have their way until fairly late in the standardization
process, so all Microsoft can be accused of here is not
respecting the Unix standards.
Once C formally adopted it, of course, it was fairly obvious
that C++ would follow suite (as it has). I think it safe to say
that any C++ compiler less than three or four years old should
support it. (I still use GB_longlong and GB_ulonglong, though.
Types defined in a system dependant header. Just in case I run
into an older compiler.)
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34