473,322 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

porting to 64 bit

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.

Jan 13 '07 #1
2 1268
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
Jan 13 '07 #2

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

Jan 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Edward | last post by:
Years ago I wrote an app in VB 4.0 16 bit. The program is still selling, but the clients want to upgrade to 32 bit. Should I go for VB 4.0 32 bit, or version 5, or version 6? There is only a...
2
by: eichin | last post by:
One of my recent projects has involved taking an accretion of sh and perl scripts and "doing them right" - making them modular, improving the error reporting, making it easier to add even more...
2
by: Anand | last post by:
Hi Are there any tools that would help in porting code from Pyton 2.3 to 2.4 ? I have gone through the whatsnew documents and created a document comparing Python 2.4 to 2.3. But so far has not...
5
by: David | last post by:
Hi everyone, I have a ActiveX EXE component written in VB6. This ActiveX EXE exposes various public methods that can be called by several other independent Windows EXE applications (also written...
5
by: Ryan Liu | last post by:
Hi All, Now I am porting CC to GCC and I have some problems. Would you mind tell me some document which have some description how to port CC to GCC ?? Thank you very much. Ryan
4
by: golu | last post by:
Has any body done the porting from oracle to sql server, what were the issues in porting the data bases? Also suggest some resources which can be helpful in the porting project TIA Golu
4
by: Chris Travers | last post by:
Hi all; A few years ago, I set about porting a PHP application from MySQL to PostgreSQL, after realizing that MySQL wasn't going to be able to handle it. In order to do this, I built a light,...
4
by: Ian | last post by:
I would like to hear from others who have considered and/or ported code from traditional C++ to C++/CLI. The class library I am considering porting to C++/CLI was written in traditional C++ with...
34
by: subramanian100in | last post by:
Is there any difference between porting and migrating. Kindly explain
5
by: shobhah | last post by:
Hi, We have a complete succsssfully working product on 32bit sparc solaris machine for which compiler used is CC 5.8 Now we are migarting our product from 32 bit to 64bit sparc solaris machine....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.