[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Ability to print the make database as json - experimental
From: |
Gisle Vanem |
Subject: |
Re: Ability to print the make database as json - experimental |
Date: |
Fri, 29 Dec 2023 12:02:33 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
Tim Murphy wrote:
HOW TO GET IT:
===============
in the feature/jprint branch on this fork:
https://github.com/tnmurphy/gmake-experimental
Got it and tried to build it. With clang-cl there is
this warning:
jprint.c(483,40): warning: omitting the parameter name in a function
definition is a
C2x extension [-Wc2x-extensions]
483 | void jstrcache_print_stats(const char *)
| ^
With 'cl' it's an error! Simple enough to fix.
But a 'gnumake -P' on a Makefile with a multi-line macro:
define MK_TEST_C
/*
* A simple test for loadable .DLLs in GNU-Make.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
endef
generates illegal JSON:
"MK_TEST_C" : {
"origin": "makefile",
"private": false,
"source": "../../Common.Windows",
"line": 396,
"define": " /*
* A simple test for loadable .DLLs in GNU-Make.
*/
#include <stdio.h>
-----------------------------
jsondump says ' unexpected char'. And 'jq' says:
parse error: Invalid string: control characters from
U+0000 through U+001F must be escaped at line 147, column 12