Git Product home page Git Product logo

lcc's People

Contributors

cwf avatar drh 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  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

lcc's Issues

src/*.md files are copied incorrectly from repository

The src/*.md files have some issue where all are cloned from the github repository incorrectly.
This manifests, when trying to compile dagcheck.c, with the error messages:

line 1: invalid character `%'
line 1: invalid character `{'
line 1: invalid character `\015'
line 2: invalid character `#'
line 2: syntax error
line 2: invalid character `\015'
line 3: syntax error
line 3: invalid character `;'
line 3: invalid character `\015'
line 4: invalid character `#'
...

This might be something related to me using WSL, but I was tipped off to the issue by this google groups post: here.

Workaround is to download all the *.md files through the github "raw" web interface for each file.

[PATCH] Cleanup unused local buffer in src/sym.c

Please review the attached patch. It simply removed a not needed allocation of a local buffer of 50 characters when the function vtoa() is called.

diff --git a/src/sym.c b/src/sym.c
index e4a6e30..00099f2 100755
--- a/src/sym.c
+++ b/src/sym.c
@@ -313,7 +313,6 @@ Symbol mksymbol(int sclass, const char *name, Type ty) {

 /* vtoa - return string for the constant v of type ty */
 char *vtoa(Type ty, Value v) {
-       char buf[50];

        ty = unqual(ty);
        switch (ty->op) {

Best regards and many thanks

Martin Ettl

Compiling to Assembly not Linux

Hi there,

I have probably not done this correctly, but for some reason I'm trying to do a simple helloworld app and generate a linux x86 binary, unfortunately it's generating what appears to be assembly.

Following instructions from this site,

http://drh.github.io/lcc/current/doc/install.html

I've compiled both driver and compiler, and then created a simple hello world app, i.e.


include ⟨stdio.h⟩

int main()
{
printf("Hello World!");
return(0);
}


compiling with gcc works great, I run it and get the text printed on screen. But when I compile with lcc, using this command,

./rcc main.c -target=x86/linux -o helloworld

a file gets produced called helloworld, but it contains assembly code, for example,


.globl main
.text.align 16
.type main,@function
main:
...


Any ideas what I'm doing wrong?

Problem to build under linux

I can't build lcc under linux (Archlinux and Manjaro), I followed the tutorial:
https://htmlpreview.github.io/?https://raw.githubusercontent.com/drh/lcc/master/doc/install.html#rcc
And try to use this script : https://groups.google.com/g/comp.compilers.lcc/c/HJ5TeSuP3gY/m/jEiwz-J_dpoJ

i still have problems compiling a simple program, i tested under debian buster and alpine linux.

Under debian:

Step 12/25 : RUN lcc hello.c -target=x86/linux
 ---> Running in ed78d5579c39
cpp: /usr/include/stdio.h:27 hello.c:1 Could not find include file <bits/libc-header-start.h>
cpp: /usr/include/stdio.h:33 hello.c:1 Could not find include file <stddef.h>
cpp: /usr/include/stdio.h:38 hello.c:1 Could not find include file <bits/types.h>
cpp: /usr/include/stdio.h:39 hello.c:1 Could not find include file <bits/types/__fpos_t.h>
cpp: /usr/include/stdio.h:40 hello.c:1 Could not find include file <bits/types/__fpos64_t.h>
cpp: /usr/include/stdio.h:41 hello.c:1 Could not find include file <bits/types/__FILE.h>
cpp: /usr/include/stdio.h:42 hello.c:1 Could not find include file <bits/types/FILE.h>
cpp: /usr/include/stdio.h:43 hello.c:1 Could not find include file <bits/types/struct_FILE.h>
cpp: /usr/include/stdio.h:133 hello.c:1 Could not find include file <bits/stdio_lim.h>
cpp: /usr/include/stdio.h:290 hello.c:1 Syntax error in #if/#elsif
cpp: /usr/include/stdio.h:363 hello.c:1 Syntax error in #if/#elsif
cpp: /usr/include/stdio.h:405 hello.c:1 Syntax error in #if/#elsif
cpp: /usr/include/stdio.h:567 hello.c:1 Syntax error in #if/#elsif
cpp: /usr/include/stdio.h:592 hello.c:1 Syntax error in #if/#elsif
cpp: /usr/include/stdio.h:781 hello.c:1 Could not find include file <bits/sys_errlist.h>
The command '/bin/sh -c lcc hello.c -target=x86/linux' returned a non-zero code: 1

Under alpine linux:

Step 11/24 : RUN lcc hello.c
 ---> Running in 3f1e0f061c10
hello.c: /usr/include/bits/alltypes.h:326: syntax error; found `va_list' expecting `;'
The command '/bin/sh -c lcc hello.c' returned a non-zero code: 1

If you want to see Dockerfile : https://github.com/bensuperpc/docker-lcc/blob/main/Dockerfile

Probably wrong assert statement in gen.c

Please take a look at following assert statement from gen.c, line 827:

    assert(p && p->sclass == REGISTER && p->sclass == REGISTER && p->x.regnode);

The statement p->sclass == REGISTER appears twice, which looks like a copy&paste error to me.

Best regards and many thanks for taking a look at this issue.

Martin Ettl

[PATCH] Cleanup unused variable in /etc/lcc.c

Please review the attached patch, it simply removes an unused variable in etc/lcc.c.

Best regards and many thanks

Martin Ettl

diff --git a/etc/lcc.c b/etc/lcc.c
index 06880b7..95b621a 100755
--- a/etc/lcc.c
+++ b/etc/lcc.c
@@ -778,10 +778,9 @@ char *strsave(const char *str) {
 char *stringf(const char *fmt, ...) {
        char buf[1024];
        va_list ap;
-       int n;

        va_start(ap, fmt);
-       n = vsprintf(buf, fmt, ap);
+       (void)vsprintf(buf, fmt, ap);
        va_end(ap);
        return strsave(buf);
 }

Pointers incorrectly become NULL

Lcc will compile this code incorrectly, making the pointer in the struct iter_obj passed to iterate become NULL when it really isn't supposed too.

#include <stdio.h>

struct iter_obj
{
    void *iterable;
};

#define new_iter_obj(iter) {iter}

void *array_item(int index, void *iterable)
{    
    if (index < 10)
    {
        return (void *) &(((int *) iterable)[index]);
    }
    else
    {
        return NULL;
    }
}

void iterate(struct iter_obj *obj)
{
    void *tmp;
    int index = 0;

    /* obj->iterable == NULL, but it should point to countdown in main */
    while ((tmp = array_item(index, obj->iterable)) != NULL)
    {
        printf("%d\n", *((int *) tmp));
        index++;
    }
}

int main()
{
    int countdown[10] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
    /* cd_iter.iterable == countdown */
    struct iter_obj cd_iter = new_iter_obj((void *) countdown);

    iterate(&cd_iter);
}

supporting long long in 32-bit host

I'm getting error when compiling following code in ubuntu 10.04 LTS:

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>

int main() {
        struct stat b1, b2;
        stat("/bin",&b1);
        stat("/usr",&b2);

        if(b1.st_dev == b2.st_dev) {
                if(b1.st_ino == b2.st_ino) {
                        printf("/bin and /usr is same i-node\n");
                }
        }
        return 0;
}

and I got

stattest.c:10: operands of == have illegal types `__rlim64_t' and `__rlim64_t'

which typedefs as __u_quad_t which is "long long"(64-bit integer) type:

bits/types.h:typedef unsigned long int __u_quad_t;

mulops_calls option recognition

main.c has an incorrect length for the mulops_calls option string on lines 158 and 159.
else if (strncmp(argv[i], "-mulops_calls=", 18) == 0) IR->mulops_calls = argv[i][18] - '0';
should be:
else if (strncmp(argv[i], "-mulops_calls=", 14) == 0) IR->mulops_calls = argv[i][14] - '0';
if I'm counting correctly.

how to run

HI dear author,
It's truly a honor to write a letter to you, I'm building your project nowadays and found the error when building as following, I wonder if there is a chance that you know the reason? :)

thank you
best regards to you
William

Building on Windows

Building lcc on Windows is basically fubar. The instruction are way outdated.

  • The identifier outp in cpp\cpp.c clashes with the Windows function of the same name. Renaming it the something else makes the problem go away. (It is only used in the cpp folder, from memory this includes :cpp.h, cpp.c, macro.c, include.c and maybe some other I forgot).
  • libc.lib no longer ships with Visual Studio. It should be replaced with libcmt.lib in etc\win32.src, which is apparently the multi-threaded version.
  • The compile output is littered with "ignoring unknown option -MLd" warnings.
  • I made it up to here, but then the test (make ... test) described in the installation guide fails because the file limits.s is generated nearly empty. The triple test (make ... triple) hangs forever.

I have not really investigated, but might it not be easier to base the Windows version on MinGW, as it is much closer to how the install works on Unix ?

Also, it would be great to offer precompiled binaries. It might at least be a temporary solution until the build system is fixed.

supporting unnamed union

in modern linux headers, unnamed union is used, for example in bits/pthreadtypes.h:

    unsigned int __nusers;
    __extension__ union
    {
      int __spins;
      __pthread_slist_t __list;
    };

when this header is included, lcc will error out:

/usr/include/bits/pthreadtypes.h:99: field name missing

assertion `bestreg` fails sometimes for some targets when there are too many locals

Thank you for LCC -- it has been a pleasure and an educational experience to work with.

The following code fails an assertion when compiled (as r.c) with rcc -Wf-target=symbolic -target=sparc/sun -S r.c :

void fails(void)
{
    int a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,
        k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;

    a |= b|c|1|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t;
    a |= b|c  |d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t;
}

On my Macbook Pro :

$ cc --version
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
$ mkdir -p build && cd build && make -C .. BUILDDIR=$PWD HOSTFILE=etc/solaris.c all
# ... build succeeds ... (as long as I #undef memmove inside cpp/unix.c to prevent clashing with system memmove)
$ ./rcc -Wf-target=symbolic -target=sparc/sun -S r.c
.global _fails
.seg "text"
Assertion failed: (bestreg), function spillee, file src/gen.c, line 686.
Abort trap: 6

In a Debian GNU/Linux VM :

$ cc --version
cc (Debian 4.9.1-19) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ mkdir -p build && cd build && make -C .. BUILDDIR=$PWD HOSTFILE=etc/solaris.c all
# ... build succeeds ... (memmove issue does not occur)
$ ./rcc -Wf-target=symbolic -target=sparc/sun -S r.c
.global _fails
.seg "text"
rcc: src/gen.c:686: spillee: Assertion `bestreg' failed.
Aborted

I first noticed this on my own backend (lcc-tenyr) and then while trying to debug, found it does similarly on sparc. I am not gunning for sparc specifically to be mended, but I am wondering if there is a target-independent bug, given that this happens even with -Wf-target=symbolic. This bug does not occur for me with -target=mips/irix or -target=x86/linux.

The problem seems to be that ralloc runs out of viable registers to spill in spillee. For my own architecture, this happens quite soon because the lastuse pointer is never updated. I am wondering if lastuse is not updated in enough cases ?

AddressSanitizer: SEGV on unknown address

Getting an ASAN SEGV report. To reproduce, I just compiled with asan enabled on x86 machine Linux. To reproduce:

./rcc -target=x86/linux file.c , where file.c the following piece of C code:

int main()
{
printf("Hello World\n");
return 0;
}

Here I attach the full ASAN report

==3559653==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x0000007ae8e3 bp 0x000000001015 sp 0x7fffffffcf20 T0)
==3559653==The signal is caused by a READ memory access.
==3559653==Hint: this fault was caused by a dereference of a high value address (see register values below). Disassemble the provided pc to learn which register was used.
#0 0x7ae8e3 in listnodes /home/elmanto/mnt/output/lcc/src/dag.c:176:35
#1 0x7ade35 in listnodes /home/elmanto/mnt/output/lcc/src/dag.c:333:13
#2 0x7a8f32 in walk /home/elmanto/mnt/output/lcc/src/dag.c:40:2
#3 0x55cfc7 in retcode /home/elmanto/mnt/output/lcc/src/stmt.c:543:2
#4 0x557d46 in statement /home/elmanto/mnt/output/lcc/src/stmt.c
#5 0x4da11c in compound /home/elmanto/mnt/output/lcc/src/decl.c:858:3
#6 0x4d5d35 in funcdefn /home/elmanto/mnt/output/lcc/src/decl.c:769:2
#7 0x4d5d35 in decl /home/elmanto/mnt/output/lcc/src/decl.c:167:5
#8 0x4d0b4a in program /home/elmanto/mnt/output/lcc/src/decl.c:40:4
#9 0x4cd190 in main /home/elmanto/mnt/output/lcc/src/main.c:81:2
#10 0x7ffff7c4f0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
#11 0x41d3fd in _start (/home/elmanto/mnt/output/build_lcc/rcc+0x41d3fd)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/elmanto/mnt/output/lcc/src/dag.c:176:35 in listnodes
==3559653==ABORTING

[PATCH] Cleanup duplicate statement in for loop in file src/profio.c

Please review the attached patch, which removes a duplicate statement in a for loop in file src/profio.c.

Probably this was a copy&paste issue.

Best regards and many thanks

Martin Ettl

diff --git a/src/profio.c b/src/profio.c
index 6cae414..87fc175 100755
--- a/src/profio.c
+++ b/src/profio.c
@@ -60,7 +60,7 @@ static void acaller(char *caller, char *file, int x, int y, in
                q->y = y;
                q->count = 0;
                for (r = &callee->callers; *r && (strcmp(q->name, (*r)->name) > 
-                       || strcmp(q->file, (*r)->file) > 0 || q->y > (*r)->y || 
+                       || strcmp(q->file, (*r)->file) > 0 || q->y > (*r)->y); r
                        ;
                q->link = *r;
                *r = q;

cpp buffer overflow on long lines

---------- Forwarded message ---------
From: nikonsmith [email protected]
Date: Mon, Jul 20, 2015 at 10:49 PM
Subject: lcc's cpp bug
To: [email protected] [email protected]

cpp bug:

when I compile a c source file which have a line that much than 32KB, it then print `Input buffer overflow' and exit process.

for example, I write a program generate a c source file that 100KB in one line,as follow:

/* generate.c */

include <stdio.h>

int code_len = 100*1024; // 100KB c source code

int main(void) {
char *str="int a%04d=10;";
int str_len = 13;
int str_nr = code_len / str_len;
int i;
for(i=0;i<str_nr;i++) {
printf(str,i);
}
printf("\nint main(void) { return 0; }\n");
return 0;
}

$ ./generate > 100k.c

$ lcc -v 100k.c
cpp: 100k.c:1 Input buffer overflow

[PATCH] Cleanup unused variable in src/stmt.c

Please review the attached patch, it removes an unused variable in src/stmt.c

Best regards and many thanks

Martin Ettl

diff --git a/src/stmt.c b/src/stmt.c
index a591d42..2e2e916 100755
--- a/src/stmt.c
+++ b/src/stmt.c
@@ -38,7 +38,6 @@ Code code(int kind) {
        return cp;
 }
 int reachable(int kind) {
-       Code cp;

        if (kind > Start) {
                Code cp;

Have a version of LCC retargetable to C99

Other compilers allow for switching between C89 and C99 - for example, GCC. To maintain compilation compatibility with other programs, LCC should have a C99 mode as well.

macOS: Builtin issues

Hello! :)

I just wanted to try this project out and made me a clone and attempted a build with mkdir out && make all BUILDDIR=./out. This is what essentially happened:

cc -g -c -Icpp -o out/getopt.o cpp/getopt.c
cpp/getopt.c:21:3: warning: add explicit braces to avoid dangling else [-Wdangling-else]
                else if (strcmp(argv[optind], "--") == 0) {
                ^
1 warning generated.
cc -g -c -Icpp -o out/unix.o cpp/unix.c
cpp/unix.c:96:1: error: expected parameter declarator
memmove(void *dp, const void *sp, size_t n)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:69:47: note: expanded from macro 'memmove'
                __builtin___memmove_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
                                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:38:63: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
                                                              ^
cpp/unix.c:96:1: error: expected ')'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:69:47: note: expanded from macro 'memmove'
                __builtin___memmove_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
                                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:38:63: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
                                                              ^
cpp/unix.c:96:1: note: to match this '('
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:69:47: note: expanded from macro 'memmove'
                __builtin___memmove_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
                                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:38:54: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
                                                     ^
cpp/unix.c:96:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
memmove(void *dp, const void *sp, size_t n)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:69:47: note: expanded from macro 'memmove'
                __builtin___memmove_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
                                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:38:32: note: expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
                               ^
cpp/unix.c:96:1: error: conflicting types for '__builtin___memmove_chk'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:69:3: note: expanded from macro 'memmove'
                __builtin___memmove_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
                ^
cpp/unix.c:96:1: note: '__builtin___memmove_chk' is a builtin with type 'void *(void *, const void *, unsigned long, unsigned long)'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:69:3: note: expanded from macro 'memmove'
                __builtin___memmove_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
                ^
cpp/unix.c:96:1: error: definition of builtin function '__builtin___memmove_chk'
memmove(void *dp, const void *sp, size_t n)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:69:3: note: expanded from macro 'memmove'
                __builtin___memmove_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
                ^
1 warning and 4 errors generated.
make: *** [out/unix.o] Error 1

macOS uses a specialized version of LLVM Clang:

$ cc --version
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Kind regards,

Ingwie.

Type rty definition should be at top

Hi Dave,
In src/stmt.c line no. 151,
Type rty definition should be at top in statement function (for C89)

Type rty = freturn(cfunc->type);

Warm Regards,
Daipayan Bhowal

[PATCH] The unsigned variable 'n' will never be negative so it is either pointless or an error to check if it is.

Please review the attached patch. The variable 'n' will never be negative so it is either pointless or an error to check if it is.

diff --git a/cpp/unix.c b/cpp/unix.c
index b3db364..400af35 100755
--- a/cpp/unix.c
+++ b/cpp/unix.c
@@ -97,7 +97,7 @@ memmove(void *dp, const void *sp, size_t n)
 {
        unsigned char *cdp, *csp;

-       if (n<=0)
+       if (n==0)
                return 0;
        cdp = dp;
        csp = (unsigned char *)sp;

Best regards and many thanks

Martin Ettl

Assignment of struct compound-literal doesn't work.

The below program will output 0.000000 for all 6 values.

#include <stdio.h>

typedef struct xy
{
    double x, y;
} t_xy;

t_xy vec(double x, double y)
{
    return ( (t_xy){x, y} );
}

t_xy operator+ (t_xy &a, t_xy &b)
{
    return ( (t_xy){a.x + b.x, a.y + b.y} );
}

int main(int argc, char *argv[])
{
    t_xy a = vec(1, 2);
    t_xy b = vec(2, 4);
    t_xy c = a + b;
    printf("a == %f %f\n", a.x, a.y);
    printf("b == %f %f\n", b.x, b.y);
    printf("c == %f %f\n", c.x, c.y);
}

The same applies even to the simplest case:

t_xy test = (t_xy){1.0, 2.0};
printf("test == %f %f\n", test.x, test.y);

Missing lcc.NET code

I have found your article in the internet where it says that you have added a cil backend.
Where is the code?

Hello i would like to do language self programming and i would like to use this lcc compiler for you

As I mentioned in the title, I want to do my own compilation using your compiler, and is it my programming language by playing in c libraries? I've tried Java proactively from you, but my programming language is not compatible with the slogan of slogan "C as powerful as python is so easy", according to the information I've read on the internet,
1-) your compiler is not borrowed like borland c, right?
2-) Not compatible with all operating systems?
3-) is not the c compiler we know?
Now why do I order them
Because of the question, sordum wikipedia is licensed. For saying
2. The question on the link to ask you about the question is #34
3. Due to the fact that the sordium has been called the processor programming compiler for some sites c programming language
I apologize for writing so long):

Preprocessor hangs on an example from the C standard

#define x    3
#define f(a) f(x * (a))
#undef  x
#define x    2
#define g    f
#define z    z[0]
#define h    g(~
#define m(a) a(w)
#define w    0,1
#define t(a) a

f(y+1) + f(f(z)) % t(t(g)(0) + t)(1);
g(x+(3,4)-w) | h 5) & m
         (f)^m(m);

/* expected: */
/*
f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1);
*/

Reproducible with the preprocessor compiled with Open Watcom C/C++ 1.9, MinGW 4.8.2, my Smaller C and run on Windows 7 x64. Also reproducible with the preprocessor compiled with gcc 4.6.3 on Ubuntu 12.04LTS.

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.