Re: [cc65] return vs. exit()

From: <silverdr1wfmh.org.pl>
Date: 2009-10-18 23:54:06
On 2009-10-18, at 20:30, Ullrich von Bassewitz wrote:

>
> On Sun, Oct 18, 2009 at 07:03:19PM +0200, Ullrich von Bassewitz wrote:
>> Thanks for the hint. I will offer a solution for this in the next  
>> major
>> release.
>
> It's in the snapshot now: You can add "__attribute__((noreturn))" to a
> function to mark it as "does not return". The standard exit()  
> function is
> already marked with this attribute in the stdlib.h header file.

Danke! Seems to work with the snapshot. BTW. Had some problems  
compiling the snapshot but I recalled the "make zap" vs. "make clean"  
discussion not so long ago and did make zap before remaking... Now  
only get some warnings here and there, like:

assertion.c:46: warning: unused parameter 'A'
and
ar65: Warning: Replacing module `systime.o' by older version

but I take them to be harmless.

One more question though. To test this new feature I adapted a test  
proggy:
//***************************************************
#include <stdio.h>
#include <stdlib.h>

int main (void)
{
	FILE *fh;
	unsigned char byte_from_file;
	fh = fopen("testfile","ro");
	while (!feof(fh))
	{
		byte_from_file = fgetc(fh);
		fputc(byte_from_file, stdout);
	}
	fclose(fh);
	exit(EXIT_SUCCESS);
}
//***************************************************

Should something as simple as the above work? It doesn't seem to.  
Target is C64 so the IO should be there, right?

-- 
SD!
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Oct 18 23:54:16 2009

This archive was generated by hypermail 2.1.8 : 2009-10-18 23:54:19 CEST