cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CODE_STYLE

From: Gisle Vanem <gvanem_at_yahoo.no>
Date: Mon, 14 Mar 2016 11:55:19 +0100

Daniel Stenberg wrote:

> It was about time that we expanded our documentation on what C code style we use in this project so I've just created
> 'docs/CODE_STYLE.md'. See https://github.com/curl/curl/blob/master/docs/CODE_STYLE.md

Regarding "No space before parentheses". That's okay.
But IMHO this is *not* okay:
  return (env[0] != '\0')?strdup(env):NULL;

(from getenv.c etc).

IMHO a rule for that specifies "adding spaces for easier reading".
Hence:
 return (env[0] != '\0') ? strdup(env) : NULL;

So I'm all for an 'Gnu indent' profile that could *only* warn on the
code-style.

-- 
--gv
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html
Received on 2016-03-14