On 16 March 2012 10:34, Johannes Pfau <nos...@example.com> wrote: > Am Mon, 12 Mar 2012 16:35:52 +0100 > schrieb "Iain Buclaw" <ibuc...@ubuntu.com>: > >> I'm picking up some old issues from bugzilla, this one is worth >> having a community review. >> >> http://d.puremagic.com/issues/show_bug.cgi?id=1949 >> >> >> Should hidden GCC features be imported from a magic module >> provided by gcc.* packages - or should the implementation be >> re-written using pragmas instead? > > I think I like the pragma approach more (as it allows auto-completion > in IDEs and seems less 'magic'), but I don't have a strong opinion here. > >> >> This is what LDC currently does (all of which would be possible >> to do in GDC): >> http://www.dsource.org/projects/ldc/wiki/Docs#Pragmas >> >> >> Discuss. :) > > > pragma(intrinsic) has the advantage that function declarations are > available, so tools like visualD / mono-D can provide auto-completion > for intrinsics. But maintaining all those pragma(intrinsics) is > additional work, so I don't know if it's worth it. And what happens for > intrinsics which are only supported on some architectures? version(ARM) > + pragma(intrinsic)? I think that's too much work, especially as we > already have working intrinsics. >
I don't think gcc intrinsics are worth thinking about changing, as I think it's fine as is. The only downside is gcc.builtins module is empty from the user perspective, so they don't know what is and isn't included when compiling. > pragma(no_typeinfo/no_moduleinfo) sounds useful (Manu will probably > like it ;-)) > > pragma(alloca): I don't know if this is needed? > > pragma(allow_inline): As we don't support dmd-compatible inline > asm anymore and gcc inline asm doesn't prevent inlining AFAIR, this > pragma isn't needed with gdc? I'm not so much interested in these as such. The higher idea behind the orginal topic really is to have a re-locatable implementation, rather than saying you must 'import core.stdc.stdarg;' to use va args properly, and lay this burden on extensive third party libraries that are able to replace druntime and phobos altogether (ie: Tango is possibly the only other). -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';