"BobR" <[EMAIL PROTECTED]> writes:

> Alexandru Mosoi wrote in message...
>> supposing that I have the following lines:
>> 
>> long long a = 12345678901234567890LL;
>> int b = a;
>> 
>> how can I make g++ (4.1.2) issue an warning because of loss of
>> precision?
>> 
>
> Use -ansi -pedantic.

int main()
{
    unsigned long long a = 12345678901234567890ULL;
    int b = a;
    return 0;
}

$ /usr/local/gcc-4.2.1/bin/g++ -ansi -pedantic t.c
t.c:3:28: warning: use of C99 long long integer constant
t.c: In function 'int main()':
t.c:3: error: ISO C++ does not support 'long long'

$ /usr/local/gcc-4.2.1/bin/gcc -ansi -pedantic t.c
t.c: In function 'main':
t.c:3: warning: ISO C90 does not support 'long long'
t.c:3:28: warning: use of C99 long long integer constant

Perhaps you should try your suggestions before suggesting them?

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to