Friday, 15 February 2013

c++ - Possible to re-enable `uint` type in g++ 4.7+? -



c++ - Possible to re-enable `uint` type in g++ 4.7+? -

i have mass of code i'm trying convert g++ version 4.2.2 4.7.2. in version 4.2.2 , prior, seems uint defined unsigned int. know not standard c++ thing , real men write iso standard c++, wondering if there flag or sort of way create g++ take uint without modifying source files. can alter cppflags or add together switch g++ runline? googles yielded nothing. have source files coming different grouping @ work , i'd take uint transgressions.

e.g.

#include <iostream> #include <fstream> #include <assert.h> using namespace std; int main(void) { uint foo = 0xdeadbeef; cout<<hex<<foo<<endl; }

yields:

/tmp/rbroger1/gcc_update rbroger1 @ plxc25804 % /usr/intel/pkgs/gcc/4.2.2/bin/g++ ~/tmp.cc && ./a.out deadbeef /tmp/rbroger1/gcc_update rbroger1 @ plxc25804 % /usr/intel/pkgs/gcc/4.7.2/bin/g++ ~/tmp.cc && ./a.out /nfs/pdx/home/rbroger1/tmp.cc: in function 'int main()': /nfs/pdx/home/rbroger1/tmp.cc:8:5: error: 'uint' not declared in scope /nfs/pdx/home/rbroger1/tmp.cc:8:10: error: expected ';' before 'foo' /nfs/pdx/home/rbroger1/tmp.cc:9:16: error: 'foo' not declared in scope

you can add together -include a_file_where_there_is_typedef_to_uint.h flag g++

from manual

-include file

process file if #include "file" appeared first line of primary source file. however, first directory searched file preprocessor's working directory instead of directory containing main source file. if not found there, searched in remainder of #include "..." search chain normal.

if multiple -include options given, files included in order appear on command line.

c++ gcc

No comments:

Post a Comment