Comment by HolyBlackCat on Is there a way to make my compiler warn if my...
@user12002570 "you yourself made the decision to" That can be said about most warnings.
View ArticleComment by HolyBlackCat on How to change the value of char in C++
It says to make a (single) character. Not a character array (aka string).
View ArticleComment by HolyBlackCat on What is error: expected unqualified-id before ‘(’...
You're getting a name conflict with a (non-standard) macro called subnormal. The easiest option is to rename the function to something else, and report a bug to the developer. Your IDE can tell you...
View ArticleComment by HolyBlackCat on How to locate the file that defines specific...
I'd use an IDE for this.
View ArticleComment by HolyBlackCat on ASCII art with SDL2, an unexpected output
Casting the pointer to Uint32* messes up your arithmetic on it. Try casting to char*, doing the arithmetic, and only then casting to Uint32*.
View ArticleComment by HolyBlackCat on Why is the sign different only for y-axis rotation?
Can you show the matrix you're talking about?
View ArticleComment by HolyBlackCat on Blurry screen in VS Code (Windows 11)
This is usually caused by bad video driver settings. Go to your nvidia control panel (for example), look for any antialiasing settings and similar, set everything to "as set by the application" instead...
View ArticleComment by HolyBlackCat on is there any UB in reinterpreting a standard...
You can access any type through unsigned char *, it's excluded from strict aliasing. Compiler adding padding between struct members could cause issues, but they don't do that in practice for members of...
View ArticleComment by HolyBlackCat on How to compile and run a C script in MSYS2
@LakshyaK2011 "MSYS2 is a toolchain, You can also use other toolchains" MSYS2 isn't a single toolchain, it offers several different ones, including a clang-based one.
View ArticleComment by HolyBlackCat on VSCode C++ fails to compile: not finding include file
Any reason why you're not installing SDL2 in MSYS2?
View ArticleComment by HolyBlackCat on What is the correct way to check for C++20...
GCC 11 and newer sets it correctly. Also it often doesn't make sense to check for C++ version, usually you care more about specific features being supported.
View ArticleComment by HolyBlackCat on VSCode on wsl2 cant find gcc/g++
Show any errors you get, the screenshots of how you've verified that you have GCC installed, and so on.
View ArticleComment by HolyBlackCat on gcc and clang disagree on using alias templates as...
I don't think it's so simple. Reminds me of cplusplus.github.io/CWG/issues/1244.html (1) talks about equivalence of types, not equivalence of templates, so it doesn't automatically bless OP's code.
View ArticleComment by HolyBlackCat on How to create sprites with C++ in a windows...
"but they all seem to be working with a console application" What do you mean by this? Yes, those work with non-console apps too. Are you talking about the project templates they choose in Visual...
View ArticleComment by HolyBlackCat on VScode terminal not showing errors in red color...
The color is enabled with -fdiagnostics-color=always GCC flag. The skipped log lines is something Ninja does, the fix going to be Ninja-specific.
View ArticleComment by HolyBlackCat on Is Cpp Core Guidelines Rule F19 incomplete?
Yes, this rule sounds like nonsense. Core guidelines are not perfect.
View ArticleComment by HolyBlackCat on How to determine the printf format specifier of a...
You could implement it yourself, but I don't think I've seen existing implementations. Why not use std::format or fmt::format instead?
View ArticleAnswer by HolyBlackCat for Why clicking header files would jump to different...
Yes, the paths look correct./usr/include is where most headers are installed. Apparently this includes libc (which is what owns stdio.h)./usr/include/x86_64-linux-gnu/c++/11 contains the C++ standard...
View ArticleAnswer by HolyBlackCat for How to determine the printf format specifier of a...
I'd prefer std::format or fmt::format, but this is how you can construct the format string for printf at compile-time:#include <algorithm>#include <cstdio>template <std::size_t...
View ArticleComment by HolyBlackCat on Clang++ issue in linkling std libraries
1. Did you only add -stdlib=libc++ when linking, and forgot to add it when compiling? 2. It shouldn't be necessary in the first place, make sure you have both gcc and g++ installed (Clang sometimes get...
View Article