On Tue, Jan 29, 2013 at 10:16 PM, Nico Weber <[email protected]> wrote: > a coworker asked me if clang documents how it handles right shifts of > signed numbers today. As far as I can tell there's no documentation > for this, but I found PR11272 about documenting implementation-defined > behavior. The bug suggests just linking to gcc's documentation as a > first step, which is what the attached patch does. This isn't quite > correct (for example, clang supports UCNs without any flags), but is > correct for most things. People can fill in more details over time.
+clang generally matches `gcc's implementation-defined +behavior <http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/C-Implementation.html#C-Implementation>`. Maybe there's a different wording that does not promise too much? I can easily see users relying on this (or complaining about Clang's implementation-defined behavior being different from gcc's). What might help is a list of implementation-defined behaviors with quotations from the standard, as a boilerplate for developers to fill in. (It is much easier to write documentation when you know what exactly you should describe.) Dmitri -- main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if (j){printf("%d\n",i);}}} /*Dmitri Gribenko <[email protected]>*/ _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
