On Tue, Jan 11, 2011 at 6:49 AM, narendra babu <[email protected]>wrote:
> Hello folks , > > I have 200+ legacy c code which were compiled using c89/c99 compilers, i > am planning to move/migrate using latest compilers and migrate to 64 bit > env , doing so i could able to fix compiler errors/warnings for 32bit-ILP > bit to 64bit-LP bit env . > > Some warnings i found is as mentioned below : > > 1 ) almost all programs are having return type as void for main , and > current compiler throws warning that main should return int , i need to > change each and every file converting return type of main from void to int > and end of main i need to add one more statement return 0; for OS . Now i would like to know is there anyway i can do that in command line of > compiler where i can make all my c programs return (0) at the end of the > main and return int for main . > what is stopping you from ignoring warnings ? , if i understood your question correctly you can use bash , sed , awk or vim , emacs ... to make those changes now figure it out how you can do it in one go . 2) Also is there any way i can get only one kind of warnings using option > in command line of compiler so that i can list which files are impacted > for a particular warning rather than all warnings , as i am compiling all > the c programs at one go . > its does not matter , warnings clearly give file names ,you can use the two stage process to compile the code create objects first then go for the linking them together later . > > i could not get any help from searching the web , just i want avoid the > manual work as there are lot of c programs and It can save a lot of time > yes you are correct thats what is learning all about . Dig more. -Satya _______________________________________________ ILUGC Mailing List: http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
