Questions tagged [tcc]

TCC is a tiny C compiler which enables you to use C as scripting language.

117 questions
3
votes
1 answer

Get backtrace under Tiny C

nptrs = backtrace(buffer, SIZE); Standard backtrace function does not work under Tiny C, (it only returns a single address). How do you get a current stack trace in a Tiny C compiled program? Update: I tried manual stack walk like this found on git…
exebook
  • 32,014
  • 33
  • 141
  • 226
3
votes
4 answers

How can i Compile a C program on Dos prompt using tcc and tc

I want to compile c program on dos prompt using tcc as well as tc without using c editor. please give the full procedure.
Sumeshsankar
  • 39
  • 1
  • 1
  • 2
3
votes
3 answers

learning c without compiling to an *.exe?

I picked up a copy of tiny c compiler (TCC) so i can do some c programming at work. Unfortunately, a new network security policy prohibits non-IT personnel from downloading/saving exe files. Of course, each time I try to complile helloworld.c the…
ridthyself
  • 821
  • 1
  • 8
  • 19
3
votes
1 answer

Can TCC be modified to compile with Emscripten? If not, where can I find an x86-generating C compiler that does?

After unzipping tcc-0.9.26, I edit configure to point at emcc instead of gcc and at emar instead of ar. Next, I uncomment the include of ucontext in tcc.h since it seems to be needed only for tccrun. Now I disable all the builtins (sub_ddmmss and so…
Janus Troelsen
  • 20,267
  • 14
  • 135
  • 196
2
votes
1 answer

Inconsistency with %hhu format specifier in C printf function?

As far as I had understood it, the %hhu format specifier should have the range of an unsigned char. However, in some compilers I test it in, it seems to have the range of an unsigned short instead. Is there a reason for this? I tried using %hhu to…
2
votes
1 answer

Use Intel ASM syntax when compiling with TinyCC

When compiling a project with Tiny C Compiler, is it possible to use Intel assembly syntax in inline assembly blocks?
Connor Bachmann
2
votes
1 answer

how do I use tcc to modify code while it's running?

in this video at about 8:05 the speaker explains he's using tcc and that allows him to change and compile code while it is already running, as long as the changes aren't too big; I imagine this isn't a very safe way to work in terms of potential…
sortai
  • 187
  • 8
2
votes
2 answers

IOCCC 1986/wall.c - why does TCC beat GCC in handling earlier C code?

Another pearl from the early IOCCC years is Larry Wall's 1986 entry: http://www.ioccc.org/years.html#1986 (wall) I suspect there is no C compiler today that can actually compile that source straight-out-of-the-box, due to the severe preprocessor…
2
votes
1 answer

Properly setting up tinycc with visual studio 2019, library libtcc1-32.a not found

I'm using tcclib to compile and run C code on the fly in my C++ project. I'm using the binaries provided here https://bellard.org/tcc/ I then open a vs2019 developer prompt and run both those command lib /def:libtcc\libtcc.def /out:libtcc.lib cl /MD…
jokoon
  • 6,207
  • 11
  • 48
  • 85
2
votes
0 answers

How to run hello world program with vala and tcc vapi

vala code using TCC; void main (string[] args) { State s = new State (); // s.add_include_path ("/usr/lib/tcc/include"); // s.add_include_path ("/usr/include/"); // s.set_lib_path ("/usr/lib/tcc"); s.compile_string (""" …
gavr
  • 807
  • 7
  • 16
2
votes
0 answers

How to find the formal grammar definition about Tiny C Compiler

Where can I find the LL(1) grammar used in TCC? Fabrice Bellard's TCC is admirable. I wanted to learn more about its source code. Its parsing is done by hand, not automatically. Now I have found decl() function is related to parsing. Can someone…
Zhou
  • 21
  • 3
2
votes
1 answer

Compile and run a file.c using Tiny C Compiler on Windows

Could I get a step by step on how to compile my file.c using Tiny C Compiler and Windows prompt? Some questions I already have: Where do I stick all TCC files from the download? Do I have to compile stdio.h to use the printf function? (I'd like to…
Eric Brotto
  • 53,471
  • 32
  • 129
  • 174
2
votes
1 answer

tcc: Use C standard functions in assembly code

I have simple assembly files created by NASM. I want to link them with tcc. For debugging I want to use printf() in my assembly code. But when I do so, tcc fails with tcc: undefined symbol 'printf'. Here is a minimal example code to reproduce the…
kaetzacoatl
  • 1,419
  • 1
  • 19
  • 27
2
votes
1 answer

tiny c compiler use GetUserName

I use the Tiny C Compiler and I want to use GetUserName from the WinAPI. My problem is, I don't know how to link to advapi32.dll I get an error from tcc: undefined symbol '_GetUserNameA@8'
binary
  • 25
  • 1
  • 4
2
votes
3 answers

packed structs in tcc

I am trying to do packed struct in tcc C compiller. Code is as follows and __attribute __ tag should be supported: #include #include typedef struct _test_t{ char c; uint16_t i; char d; }…
Nick
  • 9,962
  • 4
  • 42
  • 80