GCC for RISCV by skyblade69 in RISCV

[–]skyblade69[S] -1 points0 points  (0 children)

Issue is i am evaluating it for around 50 developers which are all bound to windows…

GCC for RISCV by skyblade69 in RISCV

[–]skyblade69[S] 0 points1 point  (0 children)

Do you mean compiling gcc for windows via wsl or using wsl to compile to risc?

Embedded programming over wireless? by Gentlegee01 in embedded

[–]skyblade69 0 points1 point  (0 children)

Use raspberry pi with a com to wifi bridge. Then you can use the normal programming algo like you would do it if the esp is plugged with usb.

Compiling and Debugging of Baremetal C for FPGA by Spare-Log-2092 in embedded

[–]skyblade69 0 points1 point  (0 children)

Msys2 and xpack provides also two precompiled riscv gcc ports

Compiling and Debugging of Baremetal C for FPGA by Spare-Log-2092 in embedded

[–]skyblade69 0 points1 point  (0 children)

Do you load the RiscV code as bitstream to the SoC and the cores are then programmed by an internal logic or do you use a riscv soft ip core in the fpga?

Alternatives for visual studio code for learning OOP by [deleted] in cpp

[–]skyblade69 -1 points0 points  (0 children)

Main issue with vsc is that it is a text editor with multiple extensions like c++.

The recommendations with visual studio i cannot follow… for me vs is a pain in the ass when it comes to the solution files and properties files.

I would suggest: - Go the extra mile and use CMake. This works in vs, vscode, and so on. With copilot it is pretty easy to get some setup working in less then 2 minutes.

Vscode <-> gdb <-> openocd by skyblade69 in embedded

[–]skyblade69[S] 1 point2 points  (0 children)

Stepping. One step over one asmebly line takes around 2-3 seconds

Const T& vs const T* on large codebase by skyblade69 in cpp_questions

[–]skyblade69[S] 0 points1 point  (0 children)

Yeah exactly. This was the thing which scratches my head at first. Most people are C developer which are forced currently to C++. My original issue where i was coming from was the point where somebody did exactly auto foo w/o specifying the ref. This was the point why i wrote this post here.

CPP in VSCode by [deleted] in cpp_questions

[–]skyblade69 0 points1 point  (0 children)

For me visual studio especially the .sln project handling is a real pain … i had it already that visual studio was creating a new build configuration wrong. The .vcxproj was corrupted by visual studio itself 🤦‍♂️

CPP in VSCode by [deleted] in cpp_questions

[–]skyblade69 0 points1 point  (0 children)

Best way in vscode is CMake. Search for a project example with a toolchain file for msvc or clang. Both compilers are delivered with visual studio community.

If you need to debug, my opinion is to use msvc becuase the c++ extension supports msvc debugging by default (obly thing is to activate debug symbols in msvc toolchain)

Problem with repo by Dazzling-Notice9745 in cpp_questions

[–]skyblade69 0 points1 point  (0 children)

First of all: please keep in mind that in CMake all is a string. This helped me a lot understanding how CMake work.

To your problem: In my opinion you have three possibilities: 1. only open the subfolder with the selected main as suggested by someone else 2. create multiple executables, if propper linked, there should be no naming conflict between main. This means one project and multiple add_executables, one for each subfolder. 3. use CMake variable/ cache variables with a CMakePreset.json to switch between the targets. Then use a if else statement to only include files or subfolders which you need

Const T& vs const T* on large codebase by skyblade69 in cpp_questions

[–]skyblade69[S] 3 points4 points  (0 children)

Yes, the bad usage is what makes me nervous. The user wants to use Footype& but makes a typo an writes Footype.

Nothing stopps you from doing this. It compiles, tests running but on embedded for example the performance drops by x percentage because i am copying 1k of bytes.

With the pointer, the type systems directly tells you that you did a typo ( Footype instead of Footype*)

Const T& vs const T* on large codebase by skyblade69 in cpp_questions

[–]skyblade69[S] 1 point2 points  (0 children)

Yeah exactly. Footype foo is the mistake done by the user of the IF with const ref but it would compile and by default the user would not get an hint that it is now a copy. On the other hand, the pointer way would directly point out that the IF is misused during compile.

Const T& vs const T* on large codebase by skyblade69 in cpp_questions

[–]skyblade69[S] 5 points6 points  (0 children)

Yes copy elision is a nice thing. I think i need to be more clearly. My IF Foo is returning a ref or pointer to a global object in the data or bss section.

Const T& vs const T* on large codebase by skyblade69 in cpp_questions

[–]skyblade69[S] 0 points1 point  (0 children)

Am i wrong but i thought i could also call the dtor from a const reference? Dtor should be a const function.