The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Operating Systems > Linux > Red Hat
.
google unix.com



Red Hat Red Hat is the world's leading open source technology solutions provider with offerings including Red Hat Enterprise Linux (RHEL), Fedora, open source applications, security and systems management, virtualization, and Services Oriented Architecture (SOA) solutions.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
64 bit Porting Problem !!! skaushal.schip SuSE 10 02-22-2009 02:51 AM
porting areef4u UNIX for Advanced & Expert Users 10 08-03-2006 09:32 AM
HP-UX to linux porting arunprakash UNIX for Dummies Questions & Answers 0 02-21-2005 05:49 AM
Porting C codes from HP-UX to AIX Sinbad AIX 0 01-27-2005 12:48 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 02-03-2009
amit_27 amit_27 is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 49
No Error for 64-bit porting

I am just trying to get the warning while compiling for 64-bit on Linux
>>
uname -a
Linux mms4.es.cpth.ie 2.6.9-22.ELsmp #1 SMP Mon Sep 19 18:00:54 EDT 2005 x86_64 x86_64 x86_64 GNU/Linux
===================================
Written test.c file which conatin :

#include<stdio.h>
#include<stdlib.h>
int main()
{
int i;
long z;
char str[10]="aaaabbbbcc";
printf("Long int size is %d bytes long!\n", sizeof(z));
printf("Int size is %d bytes !\n", sizeof(i));

i =strlen(str);
printf("\nlength = %d",i);
return 1;
}
==========================
After cimpiling gives me warning like:

$ gcc -m64 -Wall -mcpu=x86-64 -o test.o test.c
test.c: In function `main':
test.c:9: warning: int format, different type arg (arg 2)
test.c:10: warning: int format, different type arg (arg 2)
test.c:11: warning: implicit declaration of function `strlen'

There is no any warning which shows the Porting error like strlen() returns size_t which is 8 bytes on 64-bit. And 'i' is 4 bytes.

On sparcv9 it is giving warnings like

>> CC +w2 -xarch=v9 test64.cpp
"test64.cpp", line 8: Warning: Conversion of 64 bit type value to "int" causes truncation.
1 Warning(s) detected.

Can you please tell me that how could we get the similar warnings on Linux? which all options need to use with gcc for 64-bit except -m64 -Wall -mcpu=x86-64 ?
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On




All times are GMT -4. The time now is 12:56 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0