Questions tagged [godbolt]

18 questions
10
votes
1 answer

Godbolt does not show stdout

I am using https://godbolt.org/ to compile a simple C++ script but even the simplest int main() { std::cout << "Hello World!" << std::endl; } When I click Add new... --> Compiler --> Output I get: Compiler returned: 0
Hector Esteban
  • 1,011
  • 1
  • 14
  • 29
3
votes
0 answers

Compiler explorer allows multiple editors. Can the contents of one editor be #included in another editor?

Godbolt's Compiler Explorer allows the creation of additional editors. Can the body of one editor be #included in another? Something similar to this? https://godbolt.org/z/vvzE9jrzq Obviously this doesn't work, but is there a way to make this…
iwans
  • 445
  • 3
  • 13
2
votes
1 answer

Error in setting up goldbolt with childprocess launch failure

I got error in setting godbolt: https://godbolt.org/z/MYcqjeMKe Program returned: 255 [F][2022-02-14T15:04:35+0000][1] bool subproc::runChild(nsjconf_t*, int, int, int, int)():448 Launching child process failed I observed that
2
votes
2 answers

Include external header file for C on Compiler Explorer

I want to run a C project on Compiler Explorer (godbolt.org) which includes some external header files. What is the procedure to include these third-party header files on there? Screenshot of the project Suppose I want to run this code which…
Maruf Monem
  • 21
  • 1
  • 3
2
votes
1 answer

Why does godbolt show parameter being passed in edi if C++ uses cdecl calling convention?

Why does godbolt (gcc 9.3) show parameter being passed in edi if C++ uses cdecl calling convention? I can't find anything on this
user7318497
1
vote
1 answer

How to generate a multi-file godbolt project from scratch?

So from the reddit post, I got to https://godbolt.org/z/WseTsM8YG and I decided I'd try my hand at making a multi-file project on godbolt from scratch. However, something seems to be wrong. My project: https://godbolt.org/z/7asGz3Wov Seems that…
Adrian
  • 10,246
  • 4
  • 44
  • 110
1
vote
0 answers

Printf output on godbolt using xtensa compiler?

Is there some way to produce output in godbolt for the Xtensa compiler? This #include int main() { printf("Hello World!"); } generates an asm call to printf, but nothing is displayed.
glades
  • 3,778
  • 1
  • 12
  • 34
1
vote
1 answer

How to call printf() using NASM assembly on godbolt.org?

Trying to run linux NASM printf() on https://godbolt.org/z/G66bdzoof, but it's returning this error: ASM generation compiler returned: 0 /usr/bin/ld: /app/example.o:/app/example.asm:14: undefined reference to `printf' Execution build compiler…
vengy
  • 1,548
  • 10
  • 18
1
vote
1 answer

weird auto-vectorization in gcc with different results on godbolt

I'm confused by an auto-vectorization result. The following code addtest.c #include #include #define ELEMS 1024 int main() { float data1[ELEMS], data2[ELEMS]; for (int i = 0; i < ELEMS; i++) { data1[i] = drand48(); …
Ralf
  • 1,203
  • 1
  • 11
  • 20
0
votes
0 answers

Godbolt CMake with MSVC?

Does godbolt Cmake work with msvc? If so, can you get the cmake template working for me? https://godbolt.org/z/9j6Md7bGc A naïve attempt, results in msvc is trying to compile the CMakeLists.txt example.cpp (1): error C2065: 'shapes':…
Tom Huntington
  • 2,260
  • 10
  • 20
0
votes
0 answers

What compiler and options do I need to compile Raspberry Pi RP2040 code on Godbolt?

I would like to explore code optimisation on the Raspberry Pi Pico's microcontroller, RP2040, using Godbolt, but I'm not sure which compiler options to use. The microcontroller is an Arm Cortex-M0. I'd be happy if I could at least set it to compile…
Rocketmagnet
  • 5,656
  • 8
  • 36
  • 47
0
votes
0 answers

Sourcing a stored file and writing to output file in godbolt

I would like to modify the example provided by godbolt: https://godbolt.org/z/WseTsM8YG to create a project that reads from Isource.json input file and writes to Osource.json with all of the json files created and stored on the godbolt…
Tryer
  • 3,580
  • 1
  • 26
  • 49
0
votes
0 answers

Unable to download binary object on godbolt.org

Does anyone know how i will be able to download the binary object of RISC-V rv32c gcc from godbolt? I have tried all the available options.
0
votes
1 answer

How do I enable execution on a local instance of Compiler Explorer?

What do I need to do to enable execution support on a local instance of Compiler Explorer? My particular setup is on Windows 11, currently testing with MSVC 2022, with cl.exe version 19.35.32019. I tried to enable execution in the web GUI of my…
0
votes
0 answers

Mapping C/C++ source code to assembly code similar to godbolt

Our Android application has lot of code written in C/C++ and whenever a crash is reported from production users we get to know the callstack along with the registers state at the time of crash. When the crash doesn't look so evident, registers state…
Pendyala
  • 585
  • 1
  • 6
  • 17
1
2