[M3devel] fcntl last parameter int vs. pointer

Daniel Alejandro Benavides D. dabenavidesd at yahoo.es
Sat Jul 14 17:31:36 CEST 2012


Hi all:
In fact both C and Modula-3 don't allow a signature change, original C compiler and decompiler type check the signature, although type casting is possible in both languages:
http://web.cs.mun.ca/~ulf/pld/mocplus.html

However, when talking about a functional language you can override as in Baby Modula-3 the type at instantiation time for methods and values, so I guess you can sort of relax the strict rules in that relation of the two object function types (to make it a subtype):
http://www.hpl.hp.com/techreports/Compaq-DEC/SRC-RR-95.pdf

see p. 10 - S. 3.2.4 - Discussion

I just know they could make it work, but it was very hard complex system.

Thanks in advance


--- El sáb, 14/7/12, Jay K <jay.krell at cornell.edu> escribió:

De: Jay K <jay.krell at cornell.edu>
Asunto: [M3devel] fcntl last parameter int vs. pointer
Para: "m3devel" <m3devel at elegosoft.com>
Fecha: sábado, 14 de julio, 2012 03:27


Thoughts on

Unix__fcntl(int fd, int request, int arg)
{
    return fcntl(fd, request, arg);
}

vs.

Unix__fcntl(int fd, int request, INTEGER arg)
{

    return fcntl(fd, request, arg);

}



where int is 32bits and INTEGER is exactly the same size as a pointer.


Will it "just work" if I change it?
arg is sometimes a pointer, sometimes an integer, maybe sometimes other?
Ok, let's assume 32bit integer and 32bit or 64bit pointer are the only possibilities.
Are there calling conventions that care? And will pass the parameter differently/wrong?


Do any calling conventions pack multiple smaller-than-64bit parameters into one 64bit register?


I'm *guessing* no.
I guess, as well, I can experiment with a few...



 - Jay
                           
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20120714/8967f263/attachment-0002.html>


More information about the M3devel mailing list