LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] EU Rejects Patent Software Law - For Now

[ILUG] EU Rejects Patent Software Law - For Now

Colm MacCarthaigh colm at stdlib.net
Fri Feb 18 12:32:11 GMT 2005


On Fri, Feb 18, 2005 at 12:39:18PM +0000, Bryan O'Donoghue wrote:
> Almost.
> 
> But don't you chaps typecheck ?

Yep, but I know C :) In C, if you don't explicitly set return
types, or argument types two things happen. Firstly int is
the default type. That's why you can write:

main()
{
	return 0;
}

Secondly, if unspecified the type of arguments will default to
whatever is used the first time the compiler encourters a usage.
So if you have:

int somefunction(x, y)
{

}

and then later call it with two "char *", the compiler will give it
those types. I thought this was the best approach, as it's pretty
flexible. The other approach is to use void pointers (which I don't like
but that's for other reasons) and cast at every opportunity.  It works
but it can unreliable. especially if you doing comparisons which use
pointer-arithmetic. The third approach again is to have specific
inline functions for each argument type, but that's exhaustive. And of 
course the simplest approach is to use an argument-type agnostic
pre-processsor macro - which I think you'll find is what I suggested :)

But my god is this getting obscure.

-- 
Colm MacCárthaigh                        Public Key: colm+pgp at stdlib.net



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell