LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 04-23-2007, 01:23 PM   #1
digdas
LQ Newbie
 
Registered: Apr 2007
Posts: 3

Rep: Reputation: 0
Floating point exception compiling on Mandriva, run on Debian


I have compiled below program on a mandriva Sprint 2007 system (the latest)
The program has a floating point exception, when running on a debian webserver.
Older programs do work, compiled on Mandriva 2007 (the system before this one)

C-program:

1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <unistd.h>
4
5 int main( )
6 {
7 printf("Jaja\n\n");
8 }

cc -o test test.c

./test
Error message:
Floating point exception./test

Who knows what the problem is?
 
Old 04-23-2007, 06:26 PM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
well theres definitely nothing wrong with the code.. does it give the same error with 'gcc' (rather than 'cc')? does it give the same error with stdlib and unistd includes commented out?
 
Old 04-24-2007, 10:40 AM   #3
digdas
LQ Newbie
 
Registered: Apr 2007
Posts: 3

Original Poster
Rep: Reputation: 0
More information

I did the file command:


This executable does NOT work:
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), not stripped
This one does:
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped

Only difference: linked for a different Linux
 
Old 04-24-2007, 11:18 AM   #4
digdas
LQ Newbie
 
Registered: Apr 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by nadroj
well theres definitely nothing wrong with the code.. does it give the same error with 'gcc' (rather than 'cc')? does it give the same error with stdlib and unistd includes commented out?
cc and gcc are the same (there is a symbolic link from cc to gcc)
Commenting out above lines does not change the behaviour.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Amarok floating point exception JRR883 Linux - Software 1 09-25-2006 01:53 PM
Firefox: Floating point exception exit3219 Linux - Newbie 2 02-04-2006 08:53 AM
Floating point exception hemk76 Linux - Software 1 05-06-2005 11:49 PM
Depmod -> floating point exception Wynd Linux - General 0 06-26-2004 08:21 PM
[Kingpin] Floating Point Exception SiQDiZ Linux - Games 1 06-14-2004 02:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 08:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration