Need suggestion for using intypes.h features in centos5 gcc 4.1.2 compiler version.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello All,

We would like to use PRIxxx macros which is defined in <inttypes.h> (introduced in C99)  in our c++ code base which is running on centos5/gcc 4.1.2.  When we compiling the following program using gcc centos5/4.1.2 its compiled successfully

#include <inttypes.h>
#include <stdio.h>

Int main() {
Int val = 10;
printf("Value is %" PRId32, val);
return 0;
}

$> gcc PRImacros.c
Compiled and run successfully.


But at the same time, if we compile above program using centos5/g++ 4.1.2 comes as part of bundled gcc 4.1.2 package,  we got the following error

$> g++ PRImacros.cpp
PRImacros.cpp: In function 'int main()':
PRImacros.c:8: error: expected `)' before 'PRId32'

Since this PRIxxx is introduced in c99, we tried in the following way too, but got the error

$> g++ -std=c99 PRImacros.cpp
cc1plus: warning: command line option "-std=c99" is valid for C/ObjC but not for C++
PRImacros.c: In function 'int main()':
PRImacros.c:8: error: expected `)' before 'PRId32'

So our question is, Is it possible to use PRIxxx macros in c++ code running on centos5/g++ 4.1.2? If so, how to use it. Appreciate your help. Thanks in Advance.

Nantha


Internal Use Only



This communication is the property of E*TRADE Financial Corporation and its affiliates and does not constitute an offer to sell or the solicitation of an offer to buy any security. It is intended only for the person to whom it is addressed and may contain information that is privileged, confidential, or otherwise protected from disclosure. Distribution or copying of this communication, or the information contained herein, by anyone other than the intended recipient is prohibited. If you have received this communication in error, please immediately notify E*TRADE Financial Corporation at (800) 387-2331, and delete and destroy any copies hereof.





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux