tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Static variables (grischka5)


From: David A. Wheeler
Subject: Re: [Tinycc-devel] Static variables (grischka5)
Date: Wed, 02 May 2007 18:48:11 -0400 (EDT)

Rob:
> > void ((*static_stub1(void ((*p)(void)))) (void))
> *boggle*
> You have a function that takes a function pointer argument and is... 
> returning 
> a function pointer?  Ah yes, the comments say that.  (I don't think I've ever 
> declared a function that returns a function pointer before.  Or seen it 
> declared.  So that's what it looks like?)

Yes, I'm afraid that's what it looks like (eek!).  The fact that tcc can now 
correctly handle that test case is a good sign.  The _compiler_ should be nice 
and clear, but at least some of the _test cases_ should be evil (so that we can 
wring all the bugs out).

> Return value is a pointer to a function "void blah(void)";  Check, I think.  

To be fair, this isn't one of C's better areas.  Some other languages' 
notations make this kind of declaration easier; every language has its +s and 
-s.

> (How does anyone survive lisp?)

Funny you should mention that, I've defined a variant of LISP s-expressions 
called sweet-expressions which lets you use indentation, traditional 
function-call notation, and infix while still retaining the usual 
program-as-data advantages of LISPs (including macros, comma-lifting, etc.):
http://www.dwheeler.com/readable/

But anyway...

> Right.  One line fix with evil nasty test case.

:-).

--- David A. Wheeler




reply via email to

[Prev in Thread] Current Thread [Next in Thread]