[cfe-dev] OpenMP support in CLANG: A proposal

Dmitri Gribenko gribozavr at gmail.com
Wed Nov 7 19:31:18 PST 2012


Hi Mahesha,

On Wed, Nov 7, 2012 at 7:20 PM, Mahesha HS <mahesha.llvm at gmail.com> wrote:
> Sometimes, the *dry* definitions of standard (I do not hesitate to use
> the word *dry* here) makes the implementation job very messy. And, I
> am sure, it is true in all standards including C/C++ standard.

I think it would actually be easier to just handle an expression
inside the if() clause.

> GCC ( g++ ) happily reports *un-declared* error for the variable VarA
> when I do not pass -fopenmp option, and abort the compilation. Yes,
> OpenMP spirit is clearly broken here.  Though, I did not test the
> other compilers, I guess that they follow GCC for whatever the
> reasons.
>
> And, now, if Clang starts fighting against these clearly violated
> rules, it is very probable that users will start their voice against
> it.

While it makes sense to be compatible with other compilers, being
bug-for-bug compatible is clearly the wrong way to go.  This
"extension" violates the OMP spirit, has vague semantics and thus, in
my opinion, has no practical use.

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 <gribozavr at gmail.com>*/



More information about the cfe-dev mailing list