Sponsored Content
Full Discussion: No Error for 64-bit porting
Operating Systems Linux Red Hat No Error for 64-bit porting Post 302283344 by amit_27 on Tuesday 3rd of February 2009 05:56:50 AM
Old 02-03-2009
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 ?
 

7 More Discussions You Might Find Interesting

1. Programming

copying or concatinating string from 1st bit, leaving 0th bit

Hello, If i have 2 strings str1 and str2, i would like to copy/concatenate str2 to str1, from 1st bit leaving the 0th bit. How do i do it? (2 Replies)
Discussion started by: jazz
2 Replies

2. AIX

porting an application on 64-bit AIX version 5

Hi all, I am facing problem in porting to 64 bit AIX especially with compiling options to compile and run under 64 bit kernel.Can any one put some light on the issue thanks in advance vishal (14 Replies)
Discussion started by: vishalzone2002
14 Replies

3. Solaris

Porting C++ 32-bit code on 64-bit Solaris

Hi, I am trying to convert 32-bit code to 64-bit. I have defined function int main() { int* l; size_t len1; fun(len1); return 0; } void fun(int* ptr) { cout<<"\nsizeof(ptr)"<<sizeof(ptr); } However while compiling getting error as : Error: Formal argument ptr... (2 Replies)
Discussion started by: amit_27
2 Replies

4. SuSE

64 bit Porting Problem !!!

Dear All, I am trying to build my code (currently functioning on 32bit) on 64 bit SUSE machine. I am getting following error: warning: initializer element is not computable at load time dau.gss.c:275: error: initializer element is not constant dau.gss.c:275: error: (near initialization for... (10 Replies)
Discussion started by: skaushal.schip
10 Replies

5. UNIX for Advanced & Expert Users

Error compiling 32-bit Qt-4.7 on 64-bit Ubuntu OS

Hi, I am compiling Qt-4.7 for 32-bit on 64-bit (x86_64) Ubuntu 8.04 desktop. I have installed all the 32-bit libraries (/lib32 and /usr/lib32) through getlibs and "apt-get install ia32-libs". But I am getting the following error while configuring the qt project as: ./configure -platform... (2 Replies)
Discussion started by: royalibrahim
2 Replies

6. Shell Programming and Scripting

How to handle 64 bit arithmetic operation at 32 bit compiled perl interpreter?H

Hi, Here is the issue. From the program snippet I have Base: 0x1800000000, Size: 0x3FFE7FFFFFFFF which are of 40 and 56 bits. SO I used use bignum to do the math but summing them up I always failed having correct result. perl interpreter info, perl, v5.8.8 built for... (0 Replies)
Discussion started by: rrd1986
0 Replies

7. Windows & DOS: Issues & Discussions

Which version of Windows Vista to install with a product key? 32-bit or 64-bit?

Hello everyone. I bought a dell laptop (XPS M1330) online which came without a hard drive. There is a Windows Vista Ultimate OEMAct sticker with product key at the bottom case. I checked dell website (here) for this model and it says this model supports both 32 and 64-bit version of Windows... (4 Replies)
Discussion started by: milhan
4 Replies
kdump-tools.conf(5)					Linux System Administrator's Manual				       kdump-tools.conf(5)

NAME
kdump-tools.conf - configuration file for the kdump-tools init script SYNOPSIS
/etc/default/kdump-tools DESCRIPTION
kdump-tools manages the kdump feature of the Linux kernel. The /etc/default/kdump-tools file contains local configuration settings of kdump. This file is sourced into a shell script, so it's format should be consistent with shell scripting. OPTIONS
USE_KDUMP Controls whether or not kdump-tools will take any action. If not set or 0, the kdump-tools init script will not run. KDUMP_SYSCTL Controls when a panic occurs, using the sysctl(8) interface. Each time a kdump kernel is loaded, "sysctl -w $KDUMP_SYSCTL" is also executed, thus allowing the system adiminstrator to maintain customizable conditions for a kdump. The contents of this variable should be the "variable=value ..." portion of the "sysctl -w" command. If not set, "kernel.panic_on_oops=1" will be used. This feature can be disabled by setting KDUMP_SYSCTL=" " See sysctl(8) for more info. KDUMP_KERNEL A full pathname to a kdump kernel (the kernel that is kexec'd at crash time in a reserved memory area, exposing the old kernel's memory for dumping). If not set, kdump-config will use the boot kernel as the kdump kernel if it is relocatable; otherwise you must set KDUMP_KERNEL in order for kdump-tools to work. KDUMP_INITRD A full pathname to the kdump initrd (if used). If KDUMP_KERNEL is set and KDUMP_INITRD is not set, a warning message will be printed, and an initrd will not be used. KDUMP_COREDIR Full path to a directory where the vmcore will be saved. Date stamped subdirectories are created each time a vmcore file is pro- cessed. If not set, /var/crash will be used. KDUMP_FAIL_CMD This variable specifies a command to run if the vmcore save fails. If not set, no special action is taken. DEBUG_KERNEL A debug version of the running kernel. If not set, kdump-config will use /usr/lib/debug/vmlinux-$(uname-r) if it exists. Other- wise, kdump will still work, but the dump will take longer and will be much larger. MAKEDUMP_ARGS Extra arguments passed to makedumpfile(8). If not set, "-c -d 31" will be used. This tells makedumpfile to use compression, and reduce the corefile to in-use kernel pages only. See makedumpfile(8) for details. KDUMP_KEXEC_ARGS Additional arguments to the kexec command used to load the kdump kernel. KDUMP_CMDLINE Normally, the current kernel commandline is obtained from /proc/cmdline. Set this variable to override /proc/cmdline. KDUMP_CMDLINE_APPEND Additional arguments to append to the command line for the kdump kernel. If not set, "irqpoll maxcpus=1 nousb" will be used. USAGE
kdump-tools is as automated as can be at this point but there are some prerequisites to using it. Additionally, some manual configuration is still required. Manual Configuration 1. USE_KDUMP is set to 0 by default. To enable kdump-tools, edit the /etc/default/kdump-tools configuration file and set USE_KDUMP=1. 2. Kernel Command line parameters - the kernel must be booted with a crashkernel= command line parameter. Some example crashkernel parameters: ia64: crashkernel=384M x86: crashkernel=128M x86_64: crashkernel=256M Some users may also want to add nmi_watchdog=1 on certain systems. The nmi watchdog will cause the kernel to panic (and kdump) if a system hang is detected. The kernel command line parameter is generally set in one of these files: /etc/default/grub, /boot/grub/menu.lst, /etc/elilo.conf, or /etc/lilo.conf. If the command line parameter is changed, a reboot is required in order for it to take effect. 3. Architectural considerations A) x86 && PAE && memory > 4 Gigabytes - use KDUMP_KEXEC_ARGS="--elf64-core-headers" B) x86 and x86_64 - Some systems can take advantage of the nmi watchdog. Add nmi_watchdog=1 to the boot commandline to turn on the watchdog. The nmi interrupt will call panic if activated. C) ia64 - Some systems may need KDUMP_KEXEC_ARGS="--noio". Use this if the system hangs after a panic, but before the kdump kernel begins to boot. Prerequisites 1. Boot Kernel Configuration - The boot kernel must be configured with CONFIG_KEXEC=y and, if it is also to be used as the kdump ker- nel, CONFIG_CRASHDUMP=y. For ia64, only makedumpfile level 1 will work if the memory model selected is CONFIG_DISCONTIG. CONFIG_SPARSEMEM is recommended instead. 2. Kdump Kernel Configuration - The kdump kernel must be relocated or relocatable. ia64 is relocatable by default, but x86, x86_64, and powerpc must be built with CONFIG_RELOCATABLE=y. Other architectures may require a predermined start location via CONFIG_PHYSI- CAL_START. If the boot kernel is relocatable, kdump-tools will automatically use that kernel. Otherwise, a relocatable or relo- cated kernel will need to be provided. The kdump kernel can be specified in the /etc/default/kdump-tools file. Set the KDUMP_KER- NEL variable and if necessary the KDUMP_INITRD variable to point to the provided kernel and its initrd. The kdump kernel must be configured with: CONFIG_CRASH_DUMP=y 3. Debug Kernel - An uncompressed debug kernel should be provided in order for makedumpfile to process the vmcore file. Without a debug kernel, the transfer process is reduced to using "makedumpfile -c -d 1". If /usr/lib/debug/vmlinux-$(uname -r) exists, kdump- tools will automatically use that kernel. Otherwise, A) set DEBUG_KERNEL in /etc/default/kdump-tools to point to a debug version of the currently booted kernel or B) do with- out - makedumpfile will still work, but the dumpfile will be larger and take longer to save to disk. EXAMPLES
Also panic and kdump on oom: KDUMP_SYSCTL="kernel.panic_on_oops=1 vm.panic_on_oom=1" Use this option on x86 systems with PAE and more than 4 gig of memory: KDUMP_KEXEC_ARGS="--elf64-core-headers" This option starts a shell if kdump-tools cannot save the vmcore file: KDUMP_FAIL_CMD="/bin/bash; reboot -f" FILES
/etc/init.d/kdump-tools an init script to automatically load a kdump kernel, or save a vmcore and reboot. /etc/default/kdump-tools the kdump-tools configuration file /var/crash/kernel_link a link to the current debug kernel /var/crash/kexec_cmd the last kexec_cmd executed by kdump-config DIAGNOSTICS
See kdump-config(8) for explanations of various error messages. SEE ALSO
/usr/share/doc/kdump-tools/README /usr/share/doc/kdump-tools/README.Debian kdump-config(8), kexec(8), sysctl(8), makedumpfile(8), crash(8), gdb(1), AUTHOR
Terry Loftin <terry.loftin@hp.com> kdump-tools v1.1.3 April 2007 kdump-tools.conf(5)
All times are GMT -4. The time now is 08:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy