checksrc: ignore preprocessor lines

In order to check the actual code better, checksrc now ignores
everything that look like preprocessor instructions. It also means
that code in macros are now longer checked.

Note that some rules then still don't need to be followed when code is
exactly below a cpp instruction.

Removes two checksrc exceptions we needed previously because of
preprocessor lines being checked.

Reported-by: Marcel Raad
Fixes #7863
Closes #7864
This commit is contained in:
Daniel Stenberg 2021-10-16 13:50:25 +02:00
parent efffa66f65
commit 53418dbc84
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 29 additions and 13 deletions

View file

@ -1556,7 +1556,6 @@ static int test_weird_arguments(void)
}
/* DBL_MAX value from Linux */
/* !checksrc! disable PLUSNOSPACE 1 */
#define MAXIMIZE -1.7976931348623157081452E+308
static int test_float_formatting(void)

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -20,8 +20,6 @@
*
***************************************************************************/
/* !checksrc! disable ASSIGNWITHINCONDITION 14 */
/* Now include the curl_setup.h file from libcurl's private libdir (the source
version, but that might include "curl_config.h" from the build dir so we
need both of them in the include path), so that we get good in-depth