Welcome to MacBoardz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Incompatible warning using 'exit' - huh?

 
   Macintosh computer (Home) -> General Discussion RSS
Next:  Terminal UTF-8 output via ncursesw  
Author Message
campos.coder

External


Since: Jun 09, 2006
Posts: 4



(Msg. 1) Posted: Thu Jun 15, 2006 6:24 pm
Post subject: Incompatible warning using 'exit' - huh?
Archived from groups: comp>sys>mac>programmer>misc (more info?)

I'm using i686-apple-darwin8-gcc-4.0.1 to compile the following code:

#include <unistd.h>
#include <stdio.h>

int main()
{
if((write(1, "Here is some data\n", 1Cool) != 1Cool
write(2, "A write error has occured on file descriptor 1\n", 46);

exit(0);

}

Compiling with:

gcc -o simple_write simple_write.c

Getting:

simple_write.c: In function 'main':
simple_write.c:10: warning: incompatible implicit declaration of
built-in function 'exit'

-Cheers

 >> Stay informed about: Incompatible warning using 'exit' - huh? 
Back to top
Login to vote
campos.coder

External


Since: Jun 09, 2006
Posts: 4



(Msg. 2) Posted: Thu Jun 15, 2006 8:11 pm
Post subject: Re: Incompatible warning using 'exit' - huh? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I got the answer from the folks over at comp.sys.mac.programmer.help.
Simply replace the unistd.h header with stdlib.h -- and that should do
it.

-Cheers

wrote:
> I'm using i686-apple-darwin8-gcc-4.0.1 to compile the following code:
>
> #include <unistd.h>
> #include <stdio.h>
>
> int main()
> {
> if((write(1, "Here is some data\n", 1Cool) != 1Cool
> write(2, "A write error has occured on file descriptor 1\n", 46);
>
> exit(0);
>
> }
>
> Compiling with:
>
> gcc -o simple_write simple_write.c
>
> Getting:
>
> simple_write.c: In function 'main':
> simple_write.c:10: warning: incompatible implicit declaration of
> built-in function 'exit'
>
> -Cheers

 >> Stay informed about: Incompatible warning using 'exit' - huh? 
Back to top
Login to vote
Michael Ash1

External


Since: Jun 01, 2004
Posts: 617



(Msg. 3) Posted: Thu Jun 15, 2006 11:52 pm
Post subject: Re: Incompatible warning using 'exit' - huh? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

wrote:
> I got the answer from the folks over at comp.sys.mac.programmer.help.
> Simply replace the unistd.h header with stdlib.h -- and that should do
> it.

Please learn to crosspost. A correctly crossposted article will require
you to send it only once, and replies will appear automatically in all
crossposted groups. This means you don't have to write messages like this,
and readers don't have to mark the same message as read multiple times.

Also, please don't top-post.

--
Michael Ash
Rogue Amoeba Software
 >> Stay informed about: Incompatible warning using 'exit' - huh? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Wait for launched app to exit? - Hi, I've recently added code to launch another application from my current app (both are carbon apps I've written, and can modify as needed), using the call LSOpenFSRef. This iw working fine, but now I'd like the ability to wait for the launched ap...

modify OS X keyboard mappings - Hello, I need to have access to the french characters. I can do this with the Canadian - CSA keyboard. However, that keyboard has a "," as a decimal. I need a ".". Changing it in the international control panel does not change...

Shared memory - Hello all, If you're not on the beach maybe you can give me a little help. I need to implement shared memory between my application and a helper tool. At first I tried CFMessageProts. This works, but if you transport huge amounts of data the data get al...

mouse freeze - My mouse has started to freeze on booting (OS 9.03). The problem is intermittent, after touching the mouse it sometimes moves just slightly and freezes again. Can someone help? Boris vainerb@access4less.net

Can ZBasic still run on Mac OSX??? - Hi all, I was going through some older floppies and ran across some of my programs from high school written in ZBasic on the old mac classic. Is it possible to find a copy of ZBasic that'll run on a Powermac G4 with OSX Jaguar? I know this app probabl...
   Macintosh computer (Home) -> General Discussion All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]