Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > porting to 64 bit

Reply
Thread Tools

porting to 64 bit

 
 
nprashanth@gmail.com
Guest
Posts: n/a
 
      01-13-2007
Hi,

I've to port some code to a 64 bit platform (RedHat AS4). I was looking
for some compiler switches which can flag errors like this:

bash-3.00$ cat test.cpp
#include <string>

int main()
{
//unsigned long int being assigned to an unsigned int
unsigned xyz = std::string("").find("A");
}

I used some options, but they do not seem to flag the error:
bash-3.00$ g++ -c -Wconversion -Wimplicit -Wall -Wextra -m64 test.cpp
test.cpp: In function `int main()':
test.cpp:7: warning: unused variable 'xyz'

version: gcc version 3.4.5 20051201 (Red Hat 3.4.5-2)

Are there any options which can flag such errors? If no, is there any
way to find such errors?

Thanks for your time,
Prashanth.

 
Reply With Quote
 
 
 
 
noone
Guest
Posts: n/a
 
      01-13-2007
On Fri, 12 Jan 2007 21:02:43 -0800, nprashanth wrote:

> Hi,
>
> I've to port some code to a 64 bit platform (RedHat AS4). I was looking
> for some compiler switches which can flag errors like this:
>
> bash-3.00$ cat test.cpp
> #include <string>



better to look for your answer in the gnu gcc forums


 
Reply With Quote
 
 
 
 
Ondra Holub
Guest
Posts: n/a
 
      01-13-2007

nprasha...@gmail.com napsal:
> Hi,
>
> I've to port some code to a 64 bit platform (RedHat AS4). I was looking
> for some compiler switches which can flag errors like this:
>
> bash-3.00$ cat test.cpp
> #include <string>
>
> int main()
> {
> //unsigned long int being assigned to an unsigned int
> unsigned xyz = std::string("").find("A");
> }
>
> I used some options, but they do not seem to flag the error:
> bash-3.00$ g++ -c -Wconversion -Wimplicit -Wall -Wextra -m64 test.cpp
> test.cpp: In function `int main()':
> test.cpp:7: warning: unused variable 'xyz'
>
> version: gcc version 3.4.5 20051201 (Red Hat 3.4.5-2)
>
> Are there any options which can flag such errors? If no, is there any
> way to find such errors?
>
> Thanks for your time,
> Prashanth.


In any project is good approach to:
- turn on all warnings
- make code review (by other people who are not authors of code)
- use tools like valgrind or lint to check the code

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PORTING Applications from 32 bit to 64 bit Architecture Pallav singh C++ 5 04-03-2009 01:22 PM
porting application from 32 bit to 64 bit architecture Pallav singh C++ 0 04-01-2009 11:50 AM
syntax error near unexpected token `<bigaf>' - AIX C++ Application Porting from 32 bit to 64 bit r.nikhilk@gmail.com C++ 5 12-01-2005 08:03 PM
Porting C++ application on 32 bit to 64 bit on AIX - ld : 0711-317 ERROR : Undefined symbol r.nikhilk@gmail.com C++ 4 11-17-2005 02:03 AM
Porting VB 6 Applications from 32 Bit to 64 Bit =?Utf-8?B?cm9oaXQ=?= Windows 64bit 2 11-10-2005 02:33 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57