soasme / PeppaPEG

PEG Parser in ANSI C
https://soasme.com/PeppaPEG
MIT License
55 stars 7 forks source link

Compile error on header : peppa.h:1817:1: error: type qualifiers ignored on function return type #150

Open rishavs opened 2 years ago

rishavs commented 2 years ago

Describe the bug error on compiling the header file

To Reproduce

PS C:\Users\risharan\DevSpace\c\wrench> make
gcc -O2 -Wall -Wall -Wextra -Werror -Wpedantic -std=c11 .\src\wrench.c -o .\bin\wrench
In file included from .\src\wrench.c:4:
.\src\../deps/peppa.h:1817:1: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
 const P4_String P4_GetRuleName(P4_Expression* expr);
 ^~~~~
cc1.exe: all warnings being treated as errors
make: *** [Makefile:5: run] Error 1

Expected behavior the line 1817 should not be there? on commenting it, the error goes away.

Screenshots

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

rishavs commented 2 years ago

I am getting a lot of errors while trying to use Peppa. Instead of creating a new issue, I will just add them here as there is a good chance I am messing things up (I am fairly new to c). I tried the getting started tutorial

#include <stdio.h>
#include "..\deps\peppa.h"

int main(int argc, char* argv[]) {
    P4_Grammar* grammar = P4_LoadGrammar("entry = i\"hello\\nworld\";");
    if (grammar == NULL) {
        printf("Error: CreateGrammar: Error.\n");
        return 1;
    }

    P4_Source*  source = P4_CreateSource("Hello\nWORLD", "entry");
    if (source == NULL) {
        printf("Error: CreateSource: MemoryError.\n");
        return 1;
    }

    if (P4_Parse(grammar, source) != P4_Ok) {
        printf("Error: Parse: ErrCode[%u] Err[%s] Message[%s]\n",
            P4_GetError(source),
            P4_GetErrorString(P4_GetError(source)),
            P4_GetErrorMessage(source)
        );
        return 1;
    }

    P4_Node*    root = P4_GetSourceAst(source);
    char*       text = P4_CopyNodeString(root);

    printf("root span: [%lu %lu]\n", root->slice.start.pos, root->slice.stop.pos);
    printf("root start: line=%lu offset=%lu\n", root->slice.start.lineno, root->slice.start.offset);
    printf("root stop: line=%lu offset=%lu\n", root->slice.stop.lineno, root->slice.stop.offset);
    printf("root next: %p\n", root->next);
    printf("root head: %p\n", root->head);
    printf("root tail: %p\n", root->tail);
    printf("root text: %s\n", text);

    free(text);

    P4_JsonifySourceAst(stdout, root, NULL);

    P4_DeleteSource(source);
    P4_DeleteGrammar(grammar);

    return 1;
}

This is the error I am getting.

PS C:\Users\risharan\DevSpace\c\wrench> gcc -std=c90 .\src\wrench.c .\deps\peppa.c -o .\bin\wrench; .\bin\wrench.exe
In file included from .\deps\peppa.c:35:
.\deps\peppa.c:685:25: error: field '_errno' declared as a function
         int             errno;
                         ^~~~~
.\deps\peppa.c: In function 'match_literal':
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:1838:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_WRONG_LIT);
         ^~~~~~~~~~~~~~
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:1845:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_TEXT_TOO_SHORT);
         ^~~~~~~~~~~~~~
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:1851:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_WRONG_LIT);
         ^~~~~~~~~~~~~~
.\deps\peppa.c: In function 'match_range':
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:1874:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_TEXT_TOO_SHORT);
         ^~~~~~~~~~~~~~
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:1895:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_OUT_RANGED);
         ^~~~~~~~~~~~~~
.\deps\peppa.c: In function 'match_unicode_category':
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:1950:5: note: in expansion of macro 'P4_MatchRaisef'
     P4_MatchRaisef(s, P4_MatchError, E_INVALID_UNICODE_CATEGORY);
     ^~~~~~~~~~~~~~
.\deps\peppa.c: In function 'match_reference':
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:2003:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_NameError, E_NO_SUCH_RULE);
         ^~~~~~~~~~~~~~
.\deps\peppa.c: In function 'match_sequence':
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:2072:21: note: in expansion of macro 'P4_MatchRaisef'
                     P4_MatchRaisef(s, P4_IndexError, E_BACKREF_OUT_REACHED);
                     ^~~~~~~~~~~~~~
.\deps\peppa.c: In function 'match_choice':
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:2142:17: note: in expansion of macro 'P4_MatchRaisef'
                 P4_MatchRaisef(s, P4_MatchError, E_NO_ALTERNATIVE);
                 ^~~~~~~~~~~~~~
.\deps\peppa.c: In function 'match_repeat':
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:2196:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_AdvanceError, E_NO_PROGRESSING);
         ^~~~~~~~~~~~~~
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:2230:17: note: in expansion of macro 'P4_MatchRaisef'
                 P4_MatchRaisef(s, P4_MatchError, E_INSUFFICIENT_REPEAT);
                 ^~~~~~~~~~~~~~
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:2242:13: note: in expansion of macro 'P4_MatchRaisef'
             P4_MatchRaisef(s, P4_MatchError, E_NO_PROGRESSING);
             ^~~~~~~~~~~~~~
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:2261:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_EXCESSIVE_REPEAT);
         ^~~~~~~~~~~~~~
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:2266:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_INSUFFICIENT_REPEAT);
         ^~~~~~~~~~~~~~
.\deps\peppa.c: In function 'match_left_recursion':
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:2308:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_PegError, E_LEFT_RECUR_NO_LIFT);
         ^~~~~~~~~~~~~~
.\deps\peppa.c: In function 'match_negative':
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:2400:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_VIOLATE_NEGATIVE);
         ^~~~~~~~~~~~~~
.\deps\peppa.c: In function 'match_expression':
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:751:9: note: in definition of macro 'catch_err'
         __VA_ARGS__; \
         ^~~~~~~~~~~
.\deps\peppa.c:2438:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, err, E_MAX_RECURSION);
         ^~~~~~~~~~~~~~
In file included from .\deps\peppa.c:35:
.\deps\peppa.c:2475:38: error: expected identifier before '(' token
         if (err != P4_Ok && s->error.errno == 0) {
                                      ^~~~~
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:2476:13: note: in expansion of macro 'P4_MatchRaisef'
             P4_MatchRaisef(s, s->err, E_INVALID_ERROR_CALLBACK);
             ^~~~~~~~~~~~~~
.\deps\peppa.c: In function 'match_back_reference':
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:2520:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_IndexError, E_BACKREF_OUT_REACHED);
         ^~~~~~~~~~~~~~
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:2527:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_PegError, E_NO_EXPR);
         ^~~~~~~~~~~~~~
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:2532:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_PegError, E_BACKREF_TO_SELF);
         ^~~~~~~~~~~~~~
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:2540:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_StackError, E_RECURSIVE_BACKREF);
         ^~~~~~~~~~~~~~
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:2575:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_WRONG_BACKREF);
         ^~~~~~~~~~~~~~
.\deps\peppa.c: In function 'P4_Parse':
.\deps\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\deps\peppa.c:3146:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(source, P4_ValueError, E_NO_SUCH_RULE);
         ^~~~~~~~~~~~~~
.\deps\peppa.c: In function 'P4_GetErrorMessage':
.\deps\peppa.c:3202:27: error: expected identifier before '(' token
     switch (source->error.errno) {
                           ^~~~~
.\bin\wrench.exe : The term '.\bin\wrench.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name,
or if a path was included, verify that the path is correct and try again.
At line:1 char:61
+ ... d=c90 .\src\wrench.c .\deps\peppa.c -o .\bin\wrench; .\bin\wrench.exe
+                                                          ~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (.\bin\wrench.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
rishavs commented 2 years ago

I am seeing this issue in 1.16 as well. But 1.15 works fine and my program compiles.

soasme commented 2 years ago

Regarding the reported issue, I noticed GCC options -Wextra -Werror -Wpedantic are used. I will align Peppa PEG code closer to GCC in the following releases but for now the quickest way to move things forward is to remove these three compiling options.

Regarding your second comment, it seems gcc -std=c90 .\src\wrench.c .\deps\peppa.c -o .\bin\wrench; .\bin\wrench.exe does not add peppa.h to include path. Adding gcc option -I./depsmay help.

If your project has different gcc setting than Peppa PEG, you may try using Peppa PEG as a lib. See the installation guide.

rishavs commented 2 years ago

@soasme I did try other variants of invoking this.

in all -Wall is breaking compilation.

Removing '-Wall still breaks compilation on the master branch and on 1.16. Removing 'Wall works properly on 1.15

This is the output with the latest master;

PS C:\Users\risharan\DevSpace\c\wrench> gcc .\example.c .\peppa.c -o .\bin\wrench; .\bin\wrench.exe
In file included from .\peppa.c:35:
.\peppa.c:685:25: error: field '_errno' declared as a function
         int             errno;
                         ^~~~~
.\peppa.c: In function 'match_literal':
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:1842:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_WRONG_LIT);
         ^~~~~~~~~~~~~~
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:1849:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_TEXT_TOO_SHORT);
         ^~~~~~~~~~~~~~
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:1855:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_WRONG_LIT);
         ^~~~~~~~~~~~~~
.\peppa.c: In function 'match_range':
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:1878:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_TEXT_TOO_SHORT);
         ^~~~~~~~~~~~~~
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:1899:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_OUT_RANGED);
         ^~~~~~~~~~~~~~
.\peppa.c: In function 'match_unicode_category':
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:1958:5: note: in expansion of macro 'P4_MatchRaisef'
     P4_MatchRaisef(s, P4_MatchError, E_INVALID_UNICODE_CATEGORY);
     ^~~~~~~~~~~~~~
.\peppa.c: In function 'match_reference':
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:2011:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_NameError, E_NO_SUCH_RULE);
         ^~~~~~~~~~~~~~
.\peppa.c: In function 'match_sequence':
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:2080:21: note: in expansion of macro 'P4_MatchRaisef'
                     P4_MatchRaisef(s, P4_IndexError, E_BACKREF_OUT_REACHED);
                     ^~~~~~~~~~~~~~
.\peppa.c: In function 'match_choice':
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:2150:17: note: in expansion of macro 'P4_MatchRaisef'
                 P4_MatchRaisef(s, P4_MatchError, E_NO_ALTERNATIVE);
                 ^~~~~~~~~~~~~~
.\peppa.c: In function 'match_repeat':
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:2204:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_AdvanceError, E_NO_PROGRESSING);
         ^~~~~~~~~~~~~~
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:2238:17: note: in expansion of macro 'P4_MatchRaisef'
                 P4_MatchRaisef(s, P4_MatchError, E_INSUFFICIENT_REPEAT);
                 ^~~~~~~~~~~~~~
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:2250:13: note: in expansion of macro 'P4_MatchRaisef'
             P4_MatchRaisef(s, P4_MatchError, E_NO_PROGRESSING);
             ^~~~~~~~~~~~~~
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:2269:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_EXCESSIVE_REPEAT);
         ^~~~~~~~~~~~~~
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:2274:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_INSUFFICIENT_REPEAT);
         ^~~~~~~~~~~~~~
.\peppa.c: In function 'match_left_recursion':
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:2316:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_PegError, E_LEFT_RECUR_NO_LIFT);
         ^~~~~~~~~~~~~~
.\peppa.c: In function 'match_negative':
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:2408:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_VIOLATE_NEGATIVE);
         ^~~~~~~~~~~~~~
.\peppa.c: In function 'match_expression':
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:751:9: note: in definition of macro 'catch_err'
         __VA_ARGS__; \
         ^~~~~~~~~~~
.\peppa.c:2446:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, err, E_MAX_RECURSION);
         ^~~~~~~~~~~~~~
In file included from .\peppa.c:35:
.\peppa.c:2487:38: error: expected identifier before '(' token
         if (err != P4_Ok && s->error.errno == 0) {
                                      ^~~~~
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:2488:13: note: in expansion of macro 'P4_MatchRaisef'
             P4_MatchRaisef(s, s->err, E_INVALID_ERROR_CALLBACK);
             ^~~~~~~~~~~~~~
.\peppa.c: In function 'match_back_reference':
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:2532:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_IndexError, E_BACKREF_OUT_REACHED);
         ^~~~~~~~~~~~~~
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:2539:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_PegError, E_NO_EXPR);
         ^~~~~~~~~~~~~~
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:2544:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_PegError, E_BACKREF_TO_SELF);
         ^~~~~~~~~~~~~~
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:2552:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_StackError, E_RECURSIVE_BACKREF);
         ^~~~~~~~~~~~~~
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:2587:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(s, P4_MatchError, E_WRONG_BACKREF);
         ^~~~~~~~~~~~~~
.\peppa.c: In function 'P4_Parse':
.\peppa.c:812:20: error: expected identifier before '(' token
         (s)->error.errno = (eno); \
                    ^~~~~
.\peppa.c:3158:9: note: in expansion of macro 'P4_MatchRaisef'
         P4_MatchRaisef(source, P4_ValueError, E_NO_SUCH_RULE);
         ^~~~~~~~~~~~~~
.\peppa.c: In function 'P4_GetErrorMessage':
.\peppa.c:3214:27: error: expected identifier before '(' token
     switch (source->error.errno) {
                           ^~~~~
grammar syntax error: CutError: grammar syntax error: line 60:20, expect rule (char ';').

Opening peppa.c in vscode, the default error checking shows 11 errors

[{
    "resource": "/C:/Users/risharan/DevSpace/c/wrench/deps/peppa.c",
    "owner": "C/C++",
    "code": "130",
    "severity": 8,
    "message": "expected a '{'",
    "source": "C/C++",
    "startLineNumber": 700,
    "startColumn": 41,
    "endLineNumber": 700,
    "endColumn": 54
},{
    "resource": "/C:/Users/risharan/DevSpace/c/wrench/deps/peppa.c",
    "owner": "C/C++",
    "code": "130",
    "severity": 8,
    "message": "expected a '{'",
    "source": "C/C++",
    "startLineNumber": 702,
    "startColumn": 43,
    "endLineNumber": 702,
    "endColumn": 56
},{
    "resource": "/C:/Users/risharan/DevSpace/c/wrench/deps/peppa.c",
    "owner": "C/C++",
    "code": "852",
    "severity": 8,
    "message": "expression must be a pointer to a complete object type",
    "source": "C/C++",
    "startLineNumber": 1576,
    "startColumn": 16,
    "endLineNumber": 1576,
    "endColumn": 20
},{
    "resource": "/C:/Users/risharan/DevSpace/c/wrench/deps/peppa.c",
    "owner": "C/C++",
    "code": "852",
    "severity": 8,
    "message": "expression must be a pointer to a complete object type",
    "source": "C/C++",
    "startLineNumber": 1577,
    "startColumn": 16,
    "endLineNumber": 1577,
    "endColumn": 20
},{
    "resource": "/C:/Users/risharan/DevSpace/c/wrench/deps/peppa.c",
    "owner": "C/C++",
    "code": "65",
    "severity": 8,
    "message": "expected a ';'",
    "source": "C/C++",
    "startLineNumber": 1958,
    "startColumn": 14,
    "endLineNumber": 1958,
    "endColumn": 22
},{
    "resource": "/C:/Users/risharan/DevSpace/c/wrench/deps/peppa.c",
    "owner": "C/C++",
    "code": "20",
    "severity": 8,
    "message": "identifier \"backrefs\" is undefined",
    "source": "C/C++",
    "startLineNumber": 1959,
    "startColumn": 9,
    "endLineNumber": 1959,
    "endColumn": 17
},{
    "resource": "/C:/Users/risharan/DevSpace/c/wrench/deps/peppa.c",
    "owner": "C/C++",
    "code": "20",
    "severity": 8,
    "message": "identifier \"backrefs\" is undefined",
    "source": "C/C++",
    "startLineNumber": 1988,
    "startColumn": 50,
    "endLineNumber": 1988,
    "endColumn": 58
},{
    "resource": "/C:/Users/risharan/DevSpace/c/wrench/deps/peppa.c",
    "owner": "C/C++",
    "code": "20",
    "severity": 8,
    "message": "identifier \"backrefs\" is undefined",
    "source": "C/C++",
    "startLineNumber": 2008,
    "startColumn": 9,
    "endLineNumber": 2008,
    "endColumn": 18
},{
    "resource": "/C:/Users/risharan/DevSpace/c/wrench/deps/peppa.c",
    "owner": "C/C++",
    "code": "65",
    "severity": 8,
    "message": "expected a ';'",
    "source": "C/C++",
    "startLineNumber": 2378,
    "startColumn": 14,
    "endLineNumber": 2378,
    "endColumn": 23
},{
    "resource": "/C:/Users/risharan/DevSpace/c/wrench/deps/peppa.c",
    "owner": "C/C++",
    "code": "20",
    "severity": 8,
    "message": "identifier \"litstr\" is undefined",
    "source": "C/C++",
    "startLineNumber": 2379,
    "startColumn": 5,
    "endLineNumber": 2379,
    "endColumn": 14
},{
    "resource": "/C:/Users/risharan/DevSpace/c/wrench/deps/peppa.c",
    "owner": "C/C++",
    "code": "20",
    "severity": 8,
    "message": "identifier \"litstr\" is undefined",
    "source": "C/C++",
    "startLineNumber": 2382,
    "startColumn": 5,
    "endLineNumber": 2382,
    "endColumn": 14
}]
soasme commented 2 years ago

@rishavs I'm trying to open it on VS Code but no errors are showing. Compiling example.c & peppe.c on HEAD neither report an error on my side (macOS, gcc).

$ tree ./
./
├── deps
│   ├── peppa.c
│   └── peppa.h
├── src
│   └── wrench.c
└── wrench

2 directories, 4 files

$ gcc -std=c90 ./src/wrench.c ./deps/peppa.c -o wrench

$ ./wrench
root span: [0 11]
root start: line=1 offset=1
root stop: line=2 offset=5
root next: 0x0
root head: 0x0
root tail: 0x0
root text: Hello
WORLD
[{"slice":[0,11],"type":"entry"}]

I assume you are using Windows system and using gcc. I have not tested Peppa PEG on Windows system so the compatibility is not guaranteed.