Small nit on # endif changes

I'm not 100% certain if old cpp will accept this fwiw. I vaguely
remember some discussion on comp.compilers about this.

I also don't really like this style.. so if anyone doesn't feel
strongly or if it was an error please put it back

Hi,

Although your message was really hard to understand I think I finally got it: You mean the additional whitespace between '#' and 'endif', right?
(to which commit or patch are you referring?)

I think this should be fine, even GCC in traditional mode will do it right:
"Preprocessing directives are recognized only when their leading ‘#’ appears in the first column. There can be no whitespace between the beginning of the line and the ‘#’, but whitespace can follow the ‘#’."
(from Traditional miscellany (The C Preprocessor), note the last 'but')

Greetings,
Jonas

Does it work with this?
Net bsd has their own cpp which is standalone -
ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/devel/tradcpp/README.html

NetBSD may be a far off target, but iirc FreeBSD was thinking about
using it. (OpenSolaris may also be another target to import that for
licensing reasons and "we" have sent them a few patches implementing
various pieces)

I haven’t tested those cpps but I think it's consistent at least in the OpenMP runtime, just have a look into kmp.h...

The patch changed it, so it wasn't fully consistent before.. Why not
follow llvm/clang coding styles?

/*
I don't feel strongly about it, but it doesn't help readability
*/

These set of patches were done for NetBSD compatibility for the OpenMP runtime library, so I assume NetBSD cpp can parse them correctly.
r248209 | joerg | 2015-09-21 15:29:12 -0500 (Mon, 21 Sep 2015) | 2 lines
r248207 | joerg | 2015-09-21 15:21:02 -0500 (Mon, 21 Sep 2015) | 2 lines
r248204 | joerg | 2015-09-21 15:02:45 -0500 (Mon, 21 Sep 2015) | 2 lines
r248203 | joerg | 2015-09-21 14:42:05 -0500 (Mon, 21 Sep 2015) | 2 lines
r248200 | joerg | 2015-09-21 14:40:59 -0500 (Mon, 21 Sep 2015) | 2 lines
r248199 | joerg | 2015-09-21 14:38:56 -0500 (Mon, 21 Sep 2015) | 3 lines
r248198 | joerg | 2015-09-21 14:37:05 -0500 (Mon, 21 Sep 2015) | 3 lines

Internally we've been using the:
#if
...
# define
...
#endif
style, and it is most prominent in kmp_os.h and kmp.h. I believe the patch was trying to conform to that style.

-- Johnny

From: "C Bergström via Openmp-dev" <openmp-dev@lists.llvm.org>
To: "Jonas Hahnfeld" <Hahnfeld@itc.rwth-aachen.de>
Cc: "LLVM-OpenMP (openmp-dev@lists.llvm.org)" <openmp-dev@lists.llvm.org>
Sent: Friday, June 17, 2016 3:26:41 AM
Subject: Re: [Openmp-dev] Small nit on # endif changes

> I haven’t tested those cpps but I think it's consistent at least in
> the OpenMP runtime, just have a look into kmp.h...

The patch changed it, so it wasn't fully consistent before.. Why not
follow llvm/clang coding styles?

Consistency with existing code is an important consideration. In the long term, and for new code, we should be following LLVM's coding conventions. We should have a community conversation about transitioning the existing code base to LLVM's coding conventions.

-Hal