[Issue 7854] Non-C attributes allowed on extern(C) function parameters

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 12 11:55:03 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7854


Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy at yahoo.com
          Component|DMD                         |websites


--- Comment #2 from Steven Schveighoffer <schveiguy at yahoo.com> 2012-04-12 11:55:47 PDT ---
extern(C) does not have any effect on parameters.  Note that you can easily
implement extern(C) functions in D (in fact the runtime heavily relies on
this).  AFAICT, it basically is just a way to treat the symbol as demangled.

Also note that because C treats fixed-sized array parameters as pointers, and D
treats them as values, the following idiom has emerged, which would not be
possible if ref wasn't allowed:

extern(C) int pipe(ref int[2] fds);

Changing to websites, since this is really a spec issue.  The compiler is
implemented properly IMO.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list