Git Product home page Git Product logo

cparser's Introduction

cparser - A C99 parser (with GNU extensions)

Introduction

cparser is a recursive descent C99 parser written in C99. It contains a preprocessor, lexer, parser, constructs an AST and does semantic analysis. It acts as a frontend to the libFirm intermediate representation library. This way optimization and code generation is performed. The compiler supports cross compilation to multiple target architectures with a command-line switch. It comes with driver logic for calling assemblers and linkers as well as parsing command-line options. This allows it to be a drop-in replacement for gcc or clang in many situations.

Building and Installation

Requirements:

  • A C99 compiler (gcc and icc are known to work).
  • libFirm-1.22

Building with make

Unpack libfirm in a directory called libfirm in the source directory alternatively you may setup an alternate location with a 'config.mak' file. Just type 'make' in the source directory. The results are put into a directory called "build". You can override the existing preprocessor, compiler and linker flags and built-in paths for include directories by creating a 'config.mak' file.

Building with cmake

cparser has an additional cmake build system. CMake is a complexer build system than the make based build and most cparser developers do not use it. However it can adapt the compiler and linker flags to build shared libraries for a wider range of systems, provides an installation target and is often more familiar for people preparing packages for distribution.

Notes for a cparser installation

While cparser often runs fine from the source/build directory, a proper installation should be configured with correct system paths. For this a config.mak file should be created and the following variables set apropriately for the system: PREFIX, SYSTEM_INCLUDE_DIR, LOCAL_INCLUDE_DIR, COMPILER_INCLUDE_DIR, MULTILIB_M32_TRIPLE, MULTILIB_M64_TRIPLE, variant=optimize. The variable may be defined empty; See config.default.mak and Makefile for details.

Further Information and Contact

Official website: http://libfirm.org/

Contact E-Mail: [email protected]

Mailing list: https://lists.ira.uni-karlsruhe.de/mailman/listinfo/firm

Bugtracker: http://pp.ipd.kit.edu/~firm/bugs

Internet relay chat: irc://chat.freenode.net/#firm

cparser's People

Contributors

chmallon avatar eyelash avatar flowdalic avatar fread avatar ftomassetti avatar grimmick avatar ibara avatar lu-zero avatar manuelmohr avatar matzeb avatar moritzkroll avatar nilput avatar qznc avatar sgraf812 avatar shack avatar uniqp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cparser's Issues

cparser fails to compile code using aliases

void alias(int flags) asm("open");
void alias(int flags) {}
int open() {}

cparser outputs this :

Verify warning: Return X[78:10](open[71]): number of inputs does not match method type (1 inputs, 0 declared)
Aborted (core dumped)

cparser aborts on mildly complex float operations

void foo(void);

long double a = 5;
long double b = 1;
long double c = 11;
long double d = 17;
long double e, f, g, h, i, j;

int main()
{
    h = d;
    e = a + b;
    j = g + c;
    h += f;
    f += b;
    g = j + g;
    i = c + d;
    if (e + h)
        foo();
}

This gives this message :

ir/be/ia32/x86_x87.c:877: libFirm panic in x86_sim_x87_store: TODO: out of stack spill case
Aborted (core dumped)

It's marked as a TODO but it's a pretty critical bug so I'll add it to here.

cparser aborts on initializating structs in arrays

struct struct_type
{
    int member;
};

void f(int x)
{
    struct struct_type a[] = {{x}};
}

Results in cparser outputting this :

cparser: ir/opt/scalar_replace.c:242: link_all_leaf_members: Assertion `is_End(succ)' failed.
Aborted (core dumped)

cparser does not understand _Pragma

Hi --

I am an OpenBSD developer, making a package of libfirm and cparser for our package repository. I noticed during testing cparser that it doesn't understand the C99 _Pragma preprocessor operator. This is important, because in OpenBSD sys/cdefs.h, the _Pragma operator is used if the compiler identifies itself as gcc-4.0.0 or newer, which cparser does.

Here is a simple test case to demonstrate the behavior:

_Pragma("GCC warning \"hello\"") int main(void){ return 7; }

Here is the output for some other compilers:
The default OpenBSD compiler: clang-5.0.0:

pragma.c:1:1: warning: hello [-W#pragma-messages]
_Pragma("GCC warning \"hello\"") int main(void){ return 7; }
^
<scratch space>:2:6: note: expanded from here
 GCC warning "hello"
     ^
1 warning generated.

gcc-4.9.4:

pragma.c:1:13: warning: hello
 _Pragma("GCC warning \"hello\"") int main(void){ return 7; }
             ^

pcc-1.2.0DEVEL-20171102:

pragma.c, line 2: warning: gcc pragma unsupported

All three compilers go on to successfully compile the program correctly.

This is the output from cparser:

pragma.c:1:1: warning: type specifier missing; assuming 'int' [-Wimplicit-int]
pragma.c:1:9: error: expected ')', got string literal "GCC warning "hello""
pragma.c:1:34: error: expected '{' while parsing function definition, got 'int'
2 error(s), 1 warning(s)

And it does not go on to finish compiling.

As a result, I have had to change cparser's identification from gcc-4.6.0 to gcc-3.4.6 but this is not the best thing to do, as other software that looks for gcc compatibility that cparser does have will be forced to ignore it. I will say that with this change of identification, cparser is able to build the vast majority of OpenBSD software on both i386 and amd64 (I am using a checkout from after 1.22.0 that has the amd64 PIC code so that libfirm+cparser works on OpenBSD/amd64).

I am perfectly OK if cparser chooses to go the pcc route and just ignore the _Pragma. However, unlike #pragma, you cannot simply skip to the end of the line; you must ignore just that token.

__attribute__((constructor)) is ignored on static functions

#include <stdio.h>

const char* a = "nope";

__attribute__((__constructor__)) static void foo(void) {
    a = "yep";
}

int main(void) {
    puts(a);
}

Gives compiler warning "'void foo(void)' defined but not used" and resulting binary prints "nope" under cparser 8ec1a76. Prints "yep" under GCC and Clang. Removing the keyword static fixes it.

Is cparser still maintained? There haven't been any commits in 5 months or resolved issues in over a year. It doesn't look like there's much point in logging these bugs; mostly I'm just doing it so that other people can find them in case they run into the same bug.

__builtin_trap just doesn't work

void f()
{
    __builtin_trap();
}

cparser outputs this :

Verify warning: End X[54:2](f[57]): keep-alive edge only allowed on Block, PhiLoop and Call node, found Builtin T[63:9]
Aborted (core dumped)

cparser's preprocessor does not emit #pragma tokens

my build system RcB2 relies on #pragma directives surviving the preprocessor pass, but cparser -E not only filters them out, it complains about them, as if it was the compiler, not the preprocessor!

../rocksock.h:155:34: warning: encountered unknown #pragma [-Wunknown-pragmas]

btw, GCC emits the warning -Wunknown-pragmas only when a build error happens, even if it is directly specified on the command line.

[AMD64] cparser fails to compile some long double code

double g(double);

void f(long double x, long double y)
{
    g(y < 0 ? x : y) != g(y < 0 ? x : y);
}

cparser outputs this :

/tmp/fMysSN/a-0.s: Assembler messages:
/tmp/fMysSN/a-0.s:38: Error: invalid instruction suffix for `push'
/tmp/fMysSN/a-0.s:40: Error: invalid instruction suffix for `pop'
/tmp/fMysSN/a-0.s: error: assembler reported an error
1 error(s), 2 warning(s)

assertion in type.c:68: get_type_struct_size: Assertion `sizes[kind] != 0' failed.

/media/3T/git-mirror/musl[master]$ make
/media/3T/git-mirror/cparser/build/debug/cparser -m32 -std=c99 -nostdinc -ffreestanding -D_XOPEN_SOURCE=700 -I./arch/i386 -I./src/internal -I./include -Os -pipe -fomit-frame-pointer -fno-asynchronous-unwind-tables -Wa,--noexecstack -c -o src/complex/__cexp.o src/complex/__cexp.c
warning: ignoring unknown option -Wa,--noexecstack
cparser: type.c:68: get_type_struct_size: Assertion sizes[kind] != 0' failed. make: *** [src/complex/__cexp.o] Aborted make: *** Deleting filesrc/complex/__cexp.o'

this seems to be the issue with complex numbers referenced in issue #1

cparser aborts on using labels as values

void *f(void)
{
label:
  &&label;
}

With trunk cparser, this results in :

Verify warning: Block BB[64:9](f[59]): immature block found
Verify warning: Block BB[64:9](f[59]): normal block must have at least 1 input
Aborted (core dumped)

cannot compile multiple .c files at once (was: error compiling butch[1] part 2)

/media/3T/git-mirror/cparser/build/debug/cparser -m32 -Wall -D_XOPEN_SOURCE=700 -g -O0  ../lib/include/../src/stringptrlist/stringptr_splitc.c ../lib/include/../src/logger/log_puterror.c ../lib/include/../src/logger/log_putd.c ../lib/include/../src/stringptrlist/stringptrlist_dup_entries.c ../lib/include/../src/stringptr/stringptr_eq.c ../lib/include/../src/hashlist/hashlist.c ../lib/include/../src/hashlist/hashlist_iterator.c ../lib/include/../src/logger/log_put.c ../lib/include/../src/stringptrlist/stringptr_splits.c ../lib/include/../src/logger/log_putln.c ../lib/include/../src/strlib/ulz_vsnprintf.c ../lib/include/../src/sblist/sblist_delete.c ../lib/include/../src/stringptr/stringptr_rchr.c ../lib/include/../src/sblist/sblist.c ../lib/include/../src/logger/log_putc.c ../lib/include/../src/filelib/getfilename.c ../lib/include/../src/stringptrlist/stringptrlist_freeall.c ../lib/include/../src/stringptr/stringptr_tofile.c ../lib/include/../src/stringptr/stringptr_copy.c ../lib/include/../src/fileparser/fileparser_close.c ../lib/include/../src/strlib/ulz_snprintf.c ../lib/include/../src/fileparser/fileparser_getline.c ../lib/include/../src/stringptrlist/stringptrlist_contains.c ../lib/include/../src/timelib/msleep.c sha2/sha2_variables.c ../lib/include/../src/stringptr/stringptr_fromfile.c ../lib/include/../src/filelib/getfilesize.c ../lib/include/../src/strlib/ulz_fprintf.c ../lib/include/../src/strlib/isNumber.c ../lib/include/../src/stringptr/stringptr_format.c ../lib/include/../src/strlib/conv_cypher.c ../lib/include/../src/strlib/numberToString.c ../lib/include/../src/logger/log_puts.c ../lib/include/../src/stringptr/stringptr_concat.c ../lib/include/../src/stringptr/stringptr_strdup.c ../lib/include/../src/logger/log_timestamp.c butch.c ../lib/include/../src/iniparser/iniparser.c ../lib/include/../src/stringptr/stringptr_new.c sha2/sha512.c ../lib/include/../src/stringptrlist/stringptr_replace.c ../lib/include/../src/fileparser/fileparser_readline_userbuf.c ../lib/include/../src/stringptrlist/stringptrlist_freestrings.c ../lib/include/../src/stringptrlist/stringptrlist_tostring.c ../lib/include/../src/stringptr/stringptr_here.c ../lib/include/../src/stringptr/stringptr_fromchar.c ../lib/include/../src/timelib/timestamp.c ../lib/include/../src/fileparser/fileparser_open.c ../lib/include/../src/strlib/strtoint64.c ../lib/include/../src/stringptr/stringptr_hash.c ../lib/include/../src/fileparser/fileparser_readline.c      -o butch.out
cparser: token.c:52: register_token: Assertion `id >= last_id' failed.

it seems to work when i compile each C file on its own

[1] #5

cparser aborts when using __builtin_offsetof on a VLA type

int f(int n, int i)
{
    typedef int T[n];
    struct S
    {
        int a;
        T b[n];
    };
    return __builtin_offsetof(struct S, b[i]);
}

This results in this :

src/ast/constfold.c:756: panic in fold_expression: invalid expression kind for constant folding
Aborted (core dumped)

libFirm panic in assure_should_be_same_requirements: Unresolved should_be_same constraint

when you delete the src/complex directory from musl libc [1], it can be built without complex math support. this is the next issue i run into:

/media/3T/git-mirror/musl[complex-less]$ make
/media/3T/git-mirror/cparser/build/debug/cparser -m32 -std=c99 -nostdinc -ffreestanding -D_XOPEN_SOURCE=700 -I./arch/i386 -I./src/internal -I./include -Os -pipe -fomit-frame-pointer -fno-asynchronous-unwind-tables -Wa,--noexecstack -c -o src/exit/exit.o src/exit/exit.c
warning: ignoring unknown option -Wa,--noexecstack
./include/stdio.h:150:7: warning: redundant declaration for 'function ctermid' (declared at line 121:7 of "./include/unistd.h") [-Wredundant-decls]
1 warning(s)
be_Keep ANY[2695:286] not scheduled after its pred node in block Block BB858:1
ir/be/ia32/ia32_finish.c:334: libFirm panic in assure_should_be_same_requirements: Unresolved should_be_same constraint
make: *** [src/exit/exit.o] Aborted
make: *** Deleting file `src/exit/exit.o'

[1] http://www.musl-libc.org

Core dump on switch statement

cparser segfaults on following code:

int main(void){
        int i = 0;
        switch(i){
                i = i + ({case 0:; 0;});
        }
        return 0;
}
$ ./cparser/build/debug/cparser -m32 switch0.c
switch0.c:4:17: warning: statement is unreachable [-Wunreachable-code]
Verify warning: Block BB[52:3](main[54]): not reachable by blockwalker (endless loop with no kept block?)
Verify warning: Block BB[52:3](main[54]): no cfopt in block

Program received signal SIGABRT, Aborted.
$ ./cparser/build/debug/cparser --version
cparser 1.22.1(8ec1a761bf62be1028632e5eceda425d9fbeb039) using libFirm 1.22(b7f2ed734453a3185d07738016119544da27b9e8)

cparser fails to produce working assembly code for alias when using extern

int f;
extern typeof(f) bar __attribute__((alias("f")));

cparser outputs this :

test.c:2:12: warning: extern storage class ignored for alias variable 'bar' [-Wother]
warning: the amd64 backend is experimental and unfinished (consider the ia32 backend) [-Wexperimental]
/tmp/QhC47s/a-0.s: Assembler messages:
/tmp/QhC47s/a-0.s:4: Error: `bar' can't be equated to common symbol `f'
/tmp/QhC47s/a-0.s: error: assembler reported an error
1 error(s), 2 warning(s)

cparser aborts on asm with weird operands

void f(int a)
{
  asm("" : : ""(a));
}

cparser outputs this :

cparser: src/firm/ast2firm.c:4664: asm_statement_to_firm: Assertion `argument->indirect_read' failed.
Aborted (core dumped)

Ambiguities not correctly resolved & yacc grammar

Under the "tests" directory in C11parser (on GitHub: https://github.com/jhjourdan/C11parser) you will find a range of programs that exercise some of the more arcane ambiguities that many C11/C18 implementations get wrong -- including yours.

False negatives (errors reported by cparser that are not errors) in:
atomic.c, c11-noreturn.c, c1x-alignas.c, control-scope.c, function_parameter_scope.c, function_parameter_scope_extends.c, if_scopes.c, loop_scopes.c

False Positives (programs accepted by cparser that have errors) in:
bitfield_declaration_ambiguity.c, dangling_else_lookahead.c, dangling_else_lookahead.if.c, parameter_declaration_ambiguity.c, parameter_declaration_ambiguity.test.c

The following also require further examination:
aligned_struct_c18.c, atomic_parenthesis.c, bitfield_declaration_ambiguity.ok.c, bitfield_declaration_ambiguity.fail.c, dangling_else_misleading.fail.c

The C11parser contains a parser that correctly resolves the first 2 groups of programs. The lexer and parser are in CAML, but the lexer is readily convertible to C and a YACC version of the parser is also provided.

The companion article describing the situation more fully may be found here: http://gallium.inria.fr/~fpottier/publis/jourdan-fpottier-2016.pdf

The most important points made in it are that scopes are not always contiguous (as illustrated by the scope.c test files above) and resolving variable/typedef name ambiguity requires lookahead (as illustrated in dangling.c, declaration.c).

The easiest way to fix the problems -- in the process significantly simplifying cparser(!) - is to integrate the lexer and yacc grammar into cparser.

error compiling butch[1]

butch.c:512:18: error: Initialisation expression '&(stringptr){ ("#!/bin/sh\n%BUTCH_CONFIG\nexport butch_package_name=%BUTCH_PACKAGE_NAME\nbutch_cache_dir="$C"\nwget -O "$butch_cache_dir/%BUTCH_TARBALL" '%BUTCH_MIRROR_URL'\n"), (sizeof("#!/bin/sh\n%BUTCH_CONFIG\nexport butch_package_name=%BUTCH_PACKAGE_NAME\nbutch_cache_dir="$C"\nwget -O "$butch_cache_dir/%BUTCH_TARBALL" '%BUTCH_MIRROR_URL'\n") - 1) }' is not constant

[1] https://github.com/rofl0r/butch
tarball with embedded dependencies and portable Makefile is available here https://github.com/downloads/rofl0r/butch/butch-0.1.5.tar.bz2 (62KB)

btw, this test program here works

typedef struct str_struct {
        char *s;
        unsigned long l;
} str;

#define STRLIT(A) &(str) { (A), sizeof((A) - 1) }

str *test(void) {
        return STRLIT("test");
}

Segfault in is_Id (libFirm.so) due to misparse

Hello --

The following code causes a segfault in is_Id.
Ideally, cparser should reject this code on line 6 (while (c[1])) since it makes no sense in context.

Thanks!

a;
double b;
c() {
  if (a)
    if (0 % 0)
      while (c[1])
        ;
  while ((unsigned long)b)
    ;
}

pointer truncation when compiling latest cparser on musl based x86_64 linux

./src/main.c: In function 'main':
./src/main.c:323:25: warning: implicit declaration of function 'strndup' [-Wimplicit-function-declaration]
    char *const triple = strndup(name, dash - name);
                         ^~~~~~~
./src/main.c:323:25: warning: initialization makes pointer from integer without a cast [-Wint-conversion]

following patch fixes it

diff --git a/src/main.c b/src/main.c
index e1526d87..dc6ba84b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2,6 +2,7 @@
  * This file is part of cparser.
  * Copyright (C) 2012 Matthias Braun <[email protected]>
  */
+#define _GNU_SOURCE
 #include <errno.h>
 #include <stdbool.h>
 #include <stdio.h>

cparser aborts on packed bitfields

struct s
{
    unsigned front;
    unsigned a : 8;
    unsigned b : 1;
} __attribute__((packed));

void f(struct s x)
{
    x.a && x.b;
}

This code aborts with :

Edge Verifier: Block BB[60:2] reachable by 22 node(s), but the list contains 23 edge(s)
Edge Verifier: Proj T[65:3] reachable by 2 node(s), but the list contains 3 edge(s)
Verify warning: Proj Lu[185:26](f[62]): IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES set, but node cannot be found with normal edges
Aborted (core dumped)

error: failed including <stddef.h>

Hello ,cparser is a very good project. I like and study it. But I met an error.

 from cmd: ./cparser --export-ir firmforth.c
/usr/include/stdio.h:33:10: error: failed including <stddef.h>: No such file or directory
/usr/include/bits/_G_config.h:19:10: error: failed including <stddef.h>: No such file or directory
/usr/include/bits/libio.h:53:10: error: failed including <stdarg.h>: No such file or directory
/usr/include/bits/libio.h:306:3: error: 'size_t' does not name a type
/usr/include/stdio.h:46:9: error: '__gnuc_va_list' does not name a type
/usr/include/string.h:33:10: error: failed including <stddef.h>: No such file or directory
/usr/include/strings.h:23:10: error: failed including <stddef.h>: No such file or directory
/usr/include/stdlib.h:31:10: error: failed including <stddef.h>: No such file or directory
/usr/include/sys/types.h:145:10: error: failed including <stddef.h>: No such file or directory
/usr/include/alloca.h:24:10: error: failed including <stddef.h>: No such file or directory
/usr/include/stdlib.h:922:20: error: 'wchar_t' does not name a type
/usr/include/dlfcn.h:24:10: error: failed including <stddef.h>: No such file or directory
firmforth.c:8:10: error: failed including <libfirm/firm.h>: No such file or directory
firmforth.c:9:10: error: failed including <libfirm/ident.h>: No such file or directory
firmforth.h:5:10: error: failed including <stdbool.h>: No such file or directory
firmforth.h:6:10: error: failed including <libfirm/firm.h>: No such file or directory
firmforth.h:28:3: error: 'ir_entity' does not name a type
firmforth.c:26:1: error: 'ir_node' does not name a type
firmforth.c:30:1: error: 'ir_type' does not name a type
firmforth.c:65:21: error: 'ir_graph' does not name a type
firmforth.c:199:3: error: 'ident' does not name a type
firmforth.c:202:10: warning: implicit declaration of function 'id_unique' [-Wimplicit-function-declaration]
firmforth.c:202:5: warning: assignment makes pointer 'ident*' from integer 'int' without a cast [-Wother]
firmforth.c:207:28: warning: implicit declaration of function 'get_glob_type' [-Wimplicit-function-declaration]
firmforth.c:207:41: warning: initializer makes pointer 'ir_type*' from integer 'int' without a cast [-Wother]
firmforth.c:208:19: warning: implicit declaration of function 'new_entity' [-Wimplicit-function-declaration]
firmforth.c:208:8: warning: assignment makes pointer 'ir_entity*' from integer 'int' without a cast [-Wother]
firmforth.c:209:3: warning: implicit declaration of function 'set_entity_ld_ident' [-Wimplicit-function-declaration]
firmforth.c:213:19: warning: implicit declaration of function 'new_ir_graph' [-Wimplicit-function-declaration]
firmforth.c:213:31: warning: initializer makes pointer 'ir_graph*' from integer 'int' without a cast [-Wother]
firmforth.c:214:3: warning: implicit declaration of function 'set_current_ir_graph' [-Wimplicit-function-declaration]
firmforth.c:217:25: warning: implicit declaration of function 'new_Proj' [-Wimplicit-function-declaration]
firmforth.c:217:34: warning: implicit declaration of function 'get_irg_start' [-Wimplicit-function-declaration]
firmforth.c:217:54: error: identifier 'mode_T' is unknown.
firmforth.c:217:62: error: identifier 'pn_Start_T_args' is unknown.
firmforth.c:217:33: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:218:3: warning: implicit declaration of function 'set_value' [-Wimplicit-function-declaration]
firmforth.c:218:37: error: identifier 'mode_P' is unknown.
firmforth.c:220:19: warning: implicit declaration of function 'get_id_str' [-Wimplicit-function-declaration]
firmforth.c:220:8: warning: assignment makes pointer 'const char*' from integer 'int' without a cast [-Wother]
firmforth.c:236:28: warning: implicit declaration of function 'get_store' [-Wimplicit-function-declaration]
firmforth.c:236:37: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:237:20: warning: implicit declaration of function 'get_value' [-Wimplicit-function-declaration]
firmforth.c:237:33: error: identifier 'mode_P' is unknown.
firmforth.c:237:29: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:238:28: warning: implicit declaration of function 'new_Return' [-Wimplicit-function-declaration]
firmforth.c:238:38: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:240:26: warning: implicit declaration of function 'get_irg_end_block' [-Wimplicit-function-declaration]
firmforth.c:240:44: error: identifier 'current_ir_graph' is unknown.
firmforth.c:240:43: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:241:3: warning: implicit declaration of function 'add_immBlock_pred' [-Wimplicit-function-declaration]
firmforth.c:243:3: warning: implicit declaration of function 'mature_immBlock' [-Wimplicit-function-declaration]
firmforth.c:243:19: warning: implicit declaration of function 'get_cur_block' [-Wimplicit-function-declaration]
firmforth.c:244:3: warning: implicit declaration of function 'set_cur_block' [-Wimplicit-function-declaration]
firmforth.c:249:3: warning: implicit declaration of function 'scalar_replacement_opt' [-Wimplicit-function-declaration]
firmforth.c:250:3: warning: implicit declaration of function 'optimize_graph_df' [-Wimplicit-function-declaration]
firmforth.c:251:3: warning: implicit declaration of function 'optimize_cf' [-Wimplicit-function-declaration]
firmforth.c:252:3: warning: implicit declaration of function 'optimize_load_store' [-Wimplicit-function-declaration]
firmforth.c:253:3: warning: implicit declaration of function 'combo' [-Wimplicit-function-declaration]
firmforth.c:258:19: warning: implicit declaration of function 'get_entity_irg' [-Wimplicit-function-declaration]
firmforth.c:258:33: warning: initializer makes pointer 'ir_graph*' from integer 'int' without a cast [-Wother]
firmforth.c:271:3: warning: implicit declaration of function 'be_main' [-Wimplicit-function-declaration]
firmforth.c:301:3: warning: implicit declaration of function 'set_irg_entity' [-Wimplicit-function-declaration]
firmforth.c:306:3: error: identifier 'bool' is unknown.
firmforth.c:306:3: warning: initialisation of 'for'-statement has no effect [-Wunused-value]
firmforth.c:306:3: error: expected ';', got identifier 'old_irg__b'
firmforth.c:306:3: error: identifier 'old_irg__b' is unknown.
firmforth.c:306:3: error: identifier 'true' is unknown.
firmforth.c:306:3: warning: step of 'for'-statement has no effect [-Wunused-value]
firmforth.c:306:3: error: expected ')', got ';'
firmforth.c:306:3: error: identifier 'old_irg__b' is unknown.
firmforth.c:306:3: error: identifier 'false' is unknown.
firmforth.c:306:3: error: expected ';', got ')'
firmforth.c:306:3: warning: implicit declaration of function 'get_irp_n_irgs' [-Wimplicit-function-declaration]
firmforth.c:306:3: warning: implicit declaration of function 'get_irp_irg' [-Wimplicit-function-declaration]
firmforth.c:306:3: warning: initializer makes pointer 'ir_graph* const' from integer 'int' without a cast [-Wother]
firmforth.c:306:3: error: identifier 'true' is unknown.
firmforth.c:307:22: warning: implicit declaration of function 'get_irg_entity' [-Wimplicit-function-declaration]
firmforth.c:307:36: warning: initializer makes pointer 'ir_entity*' from integer 'int' without a cast [-Wother]
firmforth.c:308:5: warning: implicit declaration of function 'set_entity_linkage' [-Wimplicit-function-declaration]
firmforth.c:308:29: error: identifier 'IR_LINKAGE_NO_CODEGEN' is unknown.
firmforth.c:327:19: warning: implicit declaration of function 'get_current_ir_graph' [-Wimplicit-function-declaration]
firmforth.c:327:39: warning: initializer makes pointer 'ir_graph*' from integer 'int' without a cast [-Wother]
firmforth.c:330:3: warning: implicit declaration of function 'irg_finalize_cons' [-Wimplicit-function-declaration]
firmforth.c:331:3: warning: implicit declaration of function 'irg_assert_verify' [-Wimplicit-function-declaration]
firmforth.c:333:3: warning: implicit declaration of function 'dump_ir_graph' [-Wimplicit-function-declaration]
firmforth.c:336:3: warning: implicit declaration of function 'do_loop_inversion' [-Wimplicit-function-declaration]
firmforth.c:337:3: warning: implicit declaration of function 'optimize_reassociation' [-Wimplicit-function-declaration]
firmforth.c:338:3: warning: implicit declaration of function 'optimize_load_store' [-Wimplicit-function-declaration]
firmforth.c:340:3: warning: implicit declaration of function 'optimize_cf' [-Wimplicit-function-declaration]
firmforth.c:343:3: warning: implicit declaration of function 'inline_functions' [-Wimplicit-function-declaration]
firmforth.c:349:3: warning: implicit declaration of function 'optimize_graph_df' [-Wimplicit-function-declaration]
firmforth.c:350:3: warning: implicit declaration of function 'combo' [-Wimplicit-function-declaration]
firmforth.c:351:3: warning: implicit declaration of function 'scalar_replacement_opt' [-Wimplicit-function-declaration]
firmforth.c:352:3: warning: implicit declaration of function 'place_code' [-Wimplicit-function-declaration]
firmforth.c:355:3: warning: implicit declaration of function 'opt_jumpthreading' [-Wimplicit-function-declaration]
firmforth.c:357:3: warning: implicit declaration of function 'construct_confirms' [-Wimplicit-function-declaration]
firmforth.c:359:3: warning: implicit declaration of function 'remove_confirms' [-Wimplicit-function-declaration]
firmforth.c:366:3: warning: implicit declaration of function 'lower_highlevel_graph' [-Wimplicit-function-declaration]
firmforth.c:562:21: warning: implicit declaration of function 'new_Const_long' [-Wimplicit-function-declaration]
firmforth.c:562:36: error: identifier 'mode_Ls' is unknown.
firmforth.c:562:35: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:563:20: warning: implicit declaration of function 'get_value' [-Wimplicit-function-declaration]
firmforth.c:563:33: error: identifier 'mode_P' is unknown.
firmforth.c:563:29: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:564:11: warning: implicit declaration of function 'new_Add' [-Wimplicit-function-declaration]
firmforth.c:564:3: warning: assignment makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:565:3: warning: implicit declaration of function 'set_value' [-Wimplicit-function-declaration]
firmforth.c:566:24: warning: implicit declaration of function 'new_Load' [-Wimplicit-function-declaration]
firmforth.c:566:33: warning: implicit declaration of function 'get_store' [-Wimplicit-function-declaration]
firmforth.c:566:53: error: identifier 'mode_Lu' is unknown.
firmforth.c:566:32: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:567:28: warning: implicit declaration of function 'new_Proj' [-Wimplicit-function-declaration]
firmforth.c:567:57: error: identifier 'pn_Load_res' is unknown.
firmforth.c:567:36: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:568:48: error: identifier 'mode_M' is unknown.
firmforth.c:568:56: error: identifier 'pn_Load_M' is unknown.
firmforth.c:568:36: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:569:3: warning: implicit declaration of function 'set_store' [-Wimplicit-function-declaration]
firmforth.c:572:18: warning: implicit declaration of function 'new_Cmp' [-Wimplicit-function-declaration]
firmforth.c:574:5: error: identifier 'ir_relation_less_greater' is unknown.
firmforth.c:572:25: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:575:19: warning: implicit declaration of function 'new_Cond' [-Wimplicit-function-declaration]
firmforth.c:575:27: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:578:40: error: identifier 'mode_X' is unknown.
firmforth.c:578:48: error: identifier 'pn_Cond_true' is unknown.
firmforth.c:578:33: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:579:25: warning: implicit declaration of function 'new_immBlock' [-Wimplicit-function-declaration]
firmforth.c:579:37: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:580:3: warning: implicit declaration of function 'add_immBlock_pred' [-Wimplicit-function-declaration]
firmforth.c:583:48: error: identifier 'pn_Cond_false' is unknown.
firmforth.c:583:33: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:584:38: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:587:3: warning: implicit declaration of function 'mature_immBlock' [-Wimplicit-function-declaration]
firmforth.c:587:19: warning: implicit declaration of function 'get_cur_block' [-Wimplicit-function-declaration]
firmforth.c:589:3: warning: implicit declaration of function 'set_cur_block' [-Wimplicit-function-declaration]
firmforth.c:612:19: warning: implicit declaration of function 'new_Jmp' [-Wimplicit-function-declaration]
firmforth.c:612:26: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:613:22: warning: implicit declaration of function 'new_immBlock' [-Wimplicit-function-declaration]
firmforth.c:613:34: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:614:3: warning: implicit declaration of function 'add_immBlock_pred' [-Wimplicit-function-declaration]
firmforth.c:615:3: warning: implicit declaration of function 'mature_immBlock' [-Wimplicit-function-declaration]
firmforth.c:615:19: warning: implicit declaration of function 'get_cur_block' [-Wimplicit-function-declaration]
firmforth.c:616:3: warning: implicit declaration of function 'set_cur_block' [-Wimplicit-function-declaration]
firmforth.c:637:19: warning: implicit declaration of function 'new_Jmp' [-Wimplicit-function-declaration]
firmforth.c:637:26: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:638:3: warning: implicit declaration of function 'mature_immBlock' [-Wimplicit-function-declaration]
firmforth.c:638:19: warning: implicit declaration of function 'get_cur_block' [-Wimplicit-function-declaration]
firmforth.c:639:3: warning: implicit declaration of function 'add_immBlock_pred' [-Wimplicit-function-declaration]
firmforth.c:641:3: warning: implicit declaration of function 'set_cur_block' [-Wimplicit-function-declaration]
firmforth.c:658:19: warning: implicit declaration of function 'new_Jmp' [-Wimplicit-function-declaration]
firmforth.c:658:26: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:659:3: warning: implicit declaration of function 'mature_immBlock' [-Wimplicit-function-declaration]
firmforth.c:659:19: warning: implicit declaration of function 'get_cur_block' [-Wimplicit-function-declaration]
firmforth.c:661:22: warning: implicit declaration of function 'new_immBlock' [-Wimplicit-function-declaration]
firmforth.c:661:34: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:663:3: warning: implicit declaration of function 'set_cur_block' [-Wimplicit-function-declaration]
firmforth.c:664:3: warning: implicit declaration of function 'add_immBlock_pred' [-Wimplicit-function-declaration]
firmforth.c:666:31: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:686:19: warning: implicit declaration of function 'new_Jmp' [-Wimplicit-function-declaration]
firmforth.c:686:26: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:687:3: warning: implicit declaration of function 'add_immBlock_pred' [-Wimplicit-function-declaration]
firmforth.c:690:3: warning: implicit declaration of function 'get_store' [-Wimplicit-function-declaration]
firmforth.c:692:3: warning: implicit declaration of function 'keep_alive' [-Wimplicit-function-declaration]
firmforth.c:694:3: warning: implicit declaration of function 'mature_immBlock' [-Wimplicit-function-declaration]
firmforth.c:696:3: warning: implicit declaration of function 'set_cur_block' [-Wimplicit-function-declaration]
firmforth.c:696:17: warning: implicit declaration of function 'new_immBlock' [-Wimplicit-function-declaration]
firmforth.c:713:19: warning: implicit declaration of function 'new_Jmp' [-Wimplicit-function-declaration]
firmforth.c:713:26: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:714:3: warning: implicit declaration of function 'mature_immBlock' [-Wimplicit-function-declaration]
firmforth.c:714:19: warning: implicit declaration of function 'get_cur_block' [-Wimplicit-function-declaration]
firmforth.c:717:3: warning: implicit declaration of function 'add_immBlock_pred' [-Wimplicit-function-declaration]
firmforth.c:720:3: warning: implicit declaration of function 'set_cur_block' [-Wimplicit-function-declaration]
firmforth.c:738:22: warning: implicit declaration of function 'get_cur_block' [-Wimplicit-function-declaration]
firmforth.c:738:35: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:741:3: warning: implicit declaration of function 'set_cur_block' [-Wimplicit-function-declaration]
firmforth.c:761:18: warning: implicit declaration of function 'get_store' [-Wimplicit-function-declaration]
firmforth.c:761:27: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:765:11: warning: implicit declaration of function 'new_Address' [-Wimplicit-function-declaration]
firmforth.c:765:5: warning: assignment makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:768:11: warning: implicit declaration of function 'new_Const_long' [-Wimplicit-function-declaration]
firmforth.c:768:26: error: identifier 'mode_P' is unknown.
firmforth.c:768:5: warning: assignment makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:771:20: warning: implicit declaration of function 'get_value' [-Wimplicit-function-declaration]
firmforth.c:771:33: error: identifier 'mode_P' is unknown.
firmforth.c:771:29: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:772:19: warning: implicit declaration of function 'new_Call' [-Wimplicit-function-declaration]
firmforth.c:772:27: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:773:9: warning: implicit declaration of function 'new_Proj' [-Wimplicit-function-declaration]
firmforth.c:773:24: error: identifier 'mode_M' is unknown.
firmforth.c:773:32: error: identifier 'pn_Call_M' is unknown.
firmforth.c:773:3: warning: assignment makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:774:3: warning: implicit declaration of function 'set_store' [-Wimplicit-function-declaration]
firmforth.c:775:26: error: identifier 'mode_T' is unknown.
firmforth.c:775:34: error: identifier 'pn_Call_T_result' is unknown.
firmforth.c:775:3: warning: assignment makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:776:3: warning: assignment makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:777:3: warning: implicit declaration of function 'set_value' [-Wimplicit-function-declaration]
firmforth.c:886:23: warning: implicit declaration of function 'get_value' [-Wimplicit-function-declaration]
firmforth.c:886:36: error: identifier 'mode_P' is unknown.
firmforth.c:886:32: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:887:27: warning: implicit declaration of function 'new_Const_long' [-Wimplicit-function-declaration]
firmforth.c:887:42: error: identifier 'mode_Lu' is unknown.
firmforth.c:887:41: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:889:23: warning: implicit declaration of function 'new_Store' [-Wimplicit-function-declaration]
firmforth.c:889:33: warning: implicit declaration of function 'get_store' [-Wimplicit-function-declaration]
firmforth.c:889:32: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:890:21: warning: implicit declaration of function 'new_Proj' [-Wimplicit-function-declaration]
firmforth.c:890:37: error: identifier 'mode_M' is unknown.
firmforth.c:890:45: error: identifier 'pn_Store_M' is unknown.
firmforth.c:890:29: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:891:6: warning: implicit declaration of function 'set_store' [-Wimplicit-function-declaration]
firmforth.c:892:21: warning: implicit declaration of function 'new_Add' [-Wimplicit-function-declaration]
firmforth.c:892:51: error: identifier 'mode_Ls' is unknown.
firmforth.c:892:28: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:893:6: warning: implicit declaration of function 'set_value' [-Wimplicit-function-declaration]
firmforth.c:990:22: warning: implicit declaration of function 'get_compound_n_members' [-Wimplicit-function-declaration]
firmforth.c:990:45: warning: implicit declaration of function 'get_glob_type' [-Wimplicit-function-declaration]
firmforth.c:992:25: warning: implicit declaration of function 'get_compound_member' [-Wimplicit-function-declaration]
firmforth.c:992:44: warning: initializer makes pointer 'ir_entity*' from integer 'int' without a cast [-Wother]
firmforth.c:994:17: warning: implicit declaration of function 'get_entity_ld_name' [-Wimplicit-function-declaration]
firmforth.c:994:35: warning: call argument 1 makes pointer 'const char*' from integer 'int' without a cast [-Wother]
firmforth.c:1003:3: warning: implicit declaration of function 'ir_init' [-Wimplicit-function-declaration]
firmforth.c:1006:3: warning: implicit declaration of function 'ir_target_set' [-Wimplicit-function-declaration]
firmforth.c:1007:3: warning: implicit declaration of function 'ir_target_option' [-Wimplicit-function-declaration]
firmforth.c:1008:3: warning: implicit declaration of function 'ir_target_init' [-Wimplicit-function-declaration]
firmforth.c:1011:22: warning: implicit declaration of function 'new_type_method' [-Wimplicit-function-declaration]
firmforth.c:1011:44: error: identifier 'false' is unknown.
firmforth.c:1011:3: warning: assignment makes pointer 'ir_type*' from integer 'int' without a cast [-Wother]
firmforth.c:1012:15: warning: implicit declaration of function 'new_type_primitive' [-Wimplicit-function-declaration]
firmforth.c:1012:34: error: identifier 'mode_Ls' is unknown.
firmforth.c:1012:3: warning: assignment makes pointer 'ir_type*' from integer 'int' without a cast [-Wother]
firmforth.c:1013:19: warning: implicit declaration of function 'new_type_pointer' [-Wimplicit-function-declaration]
firmforth.c:1013:3: warning: assignment makes pointer 'ir_type*' from integer 'int' without a cast [-Wother]
firmforth.c:1014:3: warning: implicit declaration of function 'set_method_res_type' [-Wimplicit-function-declaration]
firmforth.c:1015:3: warning: implicit declaration of function 'set_method_param_type' [-Wimplicit-function-declaration]
firmforth.c:1019:7: warning: implicit declaration of function 'ir_import' [-Wimplicit-function-declaration]
firmforth.c:1031:7: error: 'ident' does not name a type
firmforth.c:1031:19: warning: implicit declaration of function 'new_id_from_str' [-Wimplicit-function-declaration]
firmforth.c:1031:34: warning: initializer makes pointer 'ident*' from integer 'int' without a cast [-Wother]
firmforth.c:1032:16: warning: implicit declaration of function 'new_entity' [-Wimplicit-function-declaration]
firmforth.c:1032:27: warning: implicit declaration of function 'get_glob_type' [-Wimplicit-function-declaration]
firmforth.c:1032:7: warning: assignment makes pointer 'ir_entity*' from integer 'int' without a cast [-Wother]
firmforth.c:1034:5: warning: implicit declaration of function 'set_entity_linkage' [-Wimplicit-function-declaration]
firmforth.c:1034:32: error: identifier 'IR_LINKAGE_NO_CODEGEN' is unknown.
firmforth.c:1039:3: error: identifier 'bool' is unknown.
firmforth.c:1039:3: warning: initialisation of 'for'-statement has no effect [-Wunused-value]
firmforth.c:1039:3: error: expected ';', got identifier 'old_irg__b'
firmforth.c:1039:3: error: identifier 'old_irg__b' is unknown.
firmforth.c:1039:3: error: identifier 'true' is unknown.
firmforth.c:1039:3: warning: step of 'for'-statement has no effect [-Wunused-value]
firmforth.c:1039:3: error: expected ')', got ';'
firmforth.c:1039:3: error: identifier 'old_irg__b' is unknown.
firmforth.c:1039:3: error: expected ';', got ')'
firmforth.c:1039:3: warning: implicit declaration of function 'get_irp_n_irgs' [-Wimplicit-function-declaration]
firmforth.c:1039:3: warning: implicit declaration of function 'get_irp_irg' [-Wimplicit-function-declaration]
firmforth.c:1039:3: warning: initializer makes pointer 'ir_graph* const' from integer 'int' without a cast [-Wother]
firmforth.c:1039:3: error: identifier 'true' is unknown.
firmforth.c:1040:5: warning: implicit declaration of function 'set_entity_linkage' [-Wimplicit-function-declaration]
firmforth.c:1040:24: warning: implicit declaration of function 'get_irg_entity' [-Wimplicit-function-declaration]
firmforth.c:1040:49: error: identifier 'IR_LINKAGE_NO_CODEGEN' is unknown.
firmforth.c:1110:3: error: 'ident' does not name a type
firmforth.c:1113:10: warning: implicit declaration of function 'id_unique' [-Wimplicit-function-declaration]
firmforth.c:1113:5: warning: assignment makes pointer 'ident*' from integer 'int' without a cast [-Wother]
firmforth.c:1118:26: warning: implicit declaration of function 'get_glob_type' [-Wimplicit-function-declaration]
firmforth.c:1118:39: warning: initializer makes pointer 'ir_type*' from integer 'int' without a cast [-Wother]
firmforth.c:1119:19: warning: implicit declaration of function 'new_entity' [-Wimplicit-function-declaration]
firmforth.c:1119:8: warning: assignment makes pointer 'ir_entity*' from integer 'int' without a cast [-Wother]
firmforth.c:1120:3: warning: implicit declaration of function 'set_entity_ld_ident' [-Wimplicit-function-declaration]
firmforth.c:1122:19: warning: implicit declaration of function 'get_id_str' [-Wimplicit-function-declaration]
firmforth.c:1122:8: warning: assignment makes pointer 'const char*' from integer 'int' without a cast [-Wother]
firmforth.c:1125:19: warning: implicit declaration of function 'new_ir_graph' [-Wimplicit-function-declaration]
firmforth.c:1125:31: warning: initializer makes pointer 'ir_graph*' from integer 'int' without a cast [-Wother]
firmforth.c:1127:3: warning: implicit declaration of function 'set_current_ir_graph' [-Wimplicit-function-declaration]
firmforth.c:1129:25: warning: implicit declaration of function 'new_Proj' [-Wimplicit-function-declaration]
firmforth.c:1129:34: warning: implicit declaration of function 'get_irg_start' [-Wimplicit-function-declaration]
firmforth.c:1129:54: error: identifier 'mode_T' is unknown.
firmforth.c:1129:62: error: identifier 'pn_Start_T_args' is unknown.
firmforth.c:1129:33: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:1132:24: warning: implicit declaration of function 'new_Const_long' [-Wimplicit-function-declaration]
firmforth.c:1132:39: error: identifier 'mode_Ls' is unknown.
firmforth.c:1132:38: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:1133:41: error: identifier 'mode_P' is unknown.
firmforth.c:1133:28: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:1134:24: warning: implicit declaration of function 'new_Sub' [-Wimplicit-function-declaration]
firmforth.c:1134:31: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:1135:24: warning: implicit declaration of function 'new_Load' [-Wimplicit-function-declaration]
firmforth.c:1135:33: warning: implicit declaration of function 'get_store' [-Wimplicit-function-declaration]
firmforth.c:1135:57: error: identifier 'mode_Lu' is unknown.
firmforth.c:1135:32: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:1136:61: error: identifier 'pn_Load_res' is unknown.
firmforth.c:1136:40: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:1137:52: error: identifier 'mode_M' is unknown.
firmforth.c:1137:60: error: identifier 'pn_Load_M' is unknown.
firmforth.c:1137:40: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:1140:31: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:1141:3: warning: assignment makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:1142:40: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:1143:40: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:1144:3: warning: implicit declaration of function 'set_store' [-Wimplicit-function-declaration]
firmforth.c:1148:20: warning: implicit declaration of function 'new_Store' [-Wimplicit-function-declaration]
firmforth.c:1148:29: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:1149:46: error: identifier 'pn_Store_M' is unknown.
firmforth.c:1149:30: warning: initializer makes pointer 'ir_node*' from integer 'int' without a cast [-Wother]
firmforth.c:1151:3: warning: implicit declaration of function 'set_value' [-Wimplicit-function-declaration]
firmforth.c:1160:33: error: identifier 'new_Shl' is unknown.
firmforth.c:1161:33: error: identifier 'new_Shr' is unknown.
firmforth.c:1162:29: error: identifier 'new_Or' is unknown.
firmforth.c:1163:30: error: identifier 'new_And' is unknown.
firmforth.c:1164:30: error: identifier 'new_Eor' is unknown.
firmforth.c:1165:28: error: identifier 'new_Mul' is unknown.
86 error(s), 225 warning(s)

system info

ubuntu 18.04

cparser can't handle wide literals

L"\x12345600";

This errors with this message :

cparser: ./src/adt/unicode.h:65: obstack_grow_utf8: Assertion `c < 0x200000' failed.
Aborted (core dumped)

musl libc[1] cannot be compiled

ast2firm.c:3741: panic in create_ir_initializer_value: initializer creation for compounds not implemented yet

is it planned to add this C99 feature soon ? imo it is crucial.
i guess this is the spot in src/aio/aio_readwrite.c that hickups:

    siginfo_t si = {
            .si_signo = sev->sigev_signo,
            .si_value = sev->sigev_value,
            .si_code = SI_ASYNCIO,
            .si_pid = __pthread_self()->pid,
            .si_uid = getuid()
    };

[1] http://www.musl-libc.org

cparser aborts on enum redefinition

enum e
{
    e1
};
enum e
{
    e1
};

cparser outputs this :

cparser: src/ast/constfold.c:378: determine_enum_values: Assertion `entry->enum_value.tv == NULL || entry->enum_value.tv == tv_next' failed.
Aborted (core dumped)

cannot compile multiple .c files at once

cparser a.c b.c c.c -o foo
./src/driver/c_driver.c:761: panic in build_firm_ir: compiling multiple files/translation units not yet supported
Aborted

this is a major bummer for me as it does not allow me to use my build system RcB2 with cparser.

can't we just compile each file on its own, write it somewhere to tmp, and then link the whole bunch together when the compiler is used liked this ?

Incorrect double-expansion of renamed macro

#define foo(x) x
#define bar foo

int main(void) {
    return bar(bar(0));
}

This fails under cparser 8ec1a76 with warning "implicit declaration of function 'foo'" and linker error "undefined reference to `foo'".

It compiles correctly under GCC 10.2.0, Clang 10.0.1, MSVC 19.27.29111 and TinyCC 0.9.27. It also compiles correctly with cparser if you replace #define bar foo with #define bar(x) foo(x).

cparser aborts on passing non-lvalue to asm

void f(int i)
{
    asm("" : : "m"(++i));
}

cparser outputs this :

src/firm/ast2firm.c:2344: panic in expression_to_addr: trying to get address of non-lvalue
Aborted (core dumped)

Obviously there is still a error in this code, but a panic like this kind of lacks information

No C99 compliant functions are used

SSIA.

$ make
...
src/driver/c_driver.c: In function ‘run_external_preprocessor’:
src/driver/c_driver.c:368:2: warning: implicit declaration of function ‘popen’ [-Wimplicit-function-declaration]
  FILE *f = popen(commandline, "r");
  ^
src/driver/c_driver.c:368:12: warning: initialization makes pointer from integer without a cast
  FILE *f = popen(commandline, "r");
            ^
CC build/debug/./src/parser/token.o
src/driver/driver.c: In function ‘close_input’:
src/driver/driver.c:136:3: warning: implicit declaration of function ‘pclose’ [-Wimplicit-function-declaration]
   res = pclose(unit->input) == EXIT_SUCCESS;
   ^
...
src/parser/preprocessor.c: In function ‘update_timestamp’:
src/parser/preprocessor.c:2798:3: warning: implicit declaration of function ‘fileno’ [-Wimplicit-function-declaration]
   int   const fd = fileno(file);
   ^
LD build/debug/cparser

according to glibc man pages,

  • using popen() and pclose() requires stdio.h and _POSIX_C_SOURCE >= 2 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE.
  • using fileno() requires stdio.h and _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _POSIX_SOURCE.
    note, src/parser/preprocessor.c does not include stdio.h explicitly.

also top Makefile has hardcoded -std=c99 -pedantic.

$ grep -e '-std=c99 -pedantic' -n Makefile
21:CFLAGS += -Wall -W -Wstrict-prototypes -Wmissing-prototypes -std=c99 -pedantic

P.S.
i don't know about cparser coding convention correctly.
but using pedantic standard explicitly by default and breaking them looks simply uncool.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.