You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-DNH3API_CLANGD, # Macro to guard code where clangd behaves weird. Do NOT define it in your code for compilation, as this is only for editing the code with clangd
4
+
-Wall, # Enable (almost) every single clang warning
5
+
-Wextra, # Enable additional warnings
6
+
-std=c++23, # Don't worry, I'm not planning to break C++17 and v141_xp compatibility, this is just to implement C++23 features
7
+
-D_X86_, # For whatever reason, WinAPI and MSVC STL requires it and the compiler doesn't define it by default
8
+
-m32, # NH3API supports only 32-bit x86 architecture
9
+
-Wno-unused-includes, # Do not warn about unused includes, this warning is broken anyway
10
+
-Wno-unsafe-buffer-usage-in-libc-call, # We can't avoid calls to functions like memcpy for performance, especially on MSVC which is poor at optimizing things
11
+
-Wno-unsafe-buffer-usage, # We also can't avoid raw pointer operations for binary compatibility (believe me, I would love to get rid of every single raw pointer in the library!)
12
+
-Wno-unused-macros, # Most macros in NH3API are defined in nh3api_std.hpp, so this is useless, too
13
+
-Wno-c++98-compat, # NH3API has dropped support for C++98/C++11/C++14
google-explicit-constructor, # In theory, this would be good but leads to more verbose code
30
+
hicpp-explicit-conversions, # Ditto
31
+
misc-misplaced-const, # const pointer (not pointers-to-const) are often used in STL code
32
+
cppcoreguidelines-avoid-c-arrays, # Can't avoid C-style arrays in the function arguments to force explicit string literals passed as parameters
33
+
hicpp-avoid-c-arrays, # Ditto
34
+
modernize-avoid-c-arrays, # Ditto
35
+
google-readability-*, # We're following the LLVM style of braces for readability, so these checks do not fit
36
+
hicpp-braces-around-statements, # Ditto
37
+
google-runtime-int, # unsigned long and unsigned int are technically not the same, so we can't just use int32_t all of the time
38
+
google-default-arguments, # Default arguments are often for binary compatibility reasons(the a)
39
+
cert-dcl51-cpp, # We can't avoid identifiers starting with the underscore because we pull a lot of code from MSVC STL and changing it is too much unnecessary work
40
+
bugprone-reserved-identifier, # Ditto
41
+
cert-dcl37-c, # Ditto
42
+
cert-dcl58-cpp, # Specializing std::hash is okay per C++ standard
43
+
cppcoreguidelines-avoid-const-or-ref-data-members, # Disabled for binary compatibility
44
+
bugprone-easily-swappable-parameters, # We have to strictly follow the original function signatures
45
+
llvmlibc-*, # These checks are relevant only inside the LLVM libc implementation
46
+
fuchsia-*, # Very cringeworthy checks
47
+
hicpp-special-member-functions, # Useless alias for cppcoreguidelines-special-member-functions
48
+
hicpp-use-auto, # auto makes the compilation a bit slower, also it doesn't always improve readability
49
+
modernize-use-auto, # Ditto
50
+
hicpp-no-assembler, # Inline assembly used for a few hacks inside NH3API
51
+
hicpp-named-parameter, # Unnamed parameters are used to silence the "unused parameter warning", now this?
52
+
modernize-use-ranges, # C++17 doesn't have std::ranges
53
+
modernize-use-trailing-return-type, # Just no. This is a really bad practice.
54
+
cppcoreguidelines-avoid-do-while, # do { ... } while(0) is often used in macros
55
+
cppcoreguidelines-avoid-magic-numbers, # I don't really want to introduce every single new enum just in one place
56
+
cppcoreguidelines-avoid-non-const-global-variables, # The game makes heavy use of non-const global variables and NH3API just follows the game architecture.
57
+
cppcoreguidelines-macro-usage, # For portability across LLVM, GCC and MSVC, we can't really avoid macros.
58
+
misc-non-private-member-variables-in-classes, # In NH3API every game type variable is public
cppcoreguidelines-pro-bounds-constant-array-index, # This is just insane.
61
+
cppcoreguidelines-pro-bounds-pointer-arithmetic, # Not always possible to avoid completely
62
+
cppcoreguidelines-pro-type-const-cast, # Not always possible to write const-correct code with virtual functions without const_cast.
63
+
cppcoreguidelines-pro-type-member-init, # Disabled for performance reasons (NH3API is supposed to be completely zero-cost abstraction)
64
+
hicpp-member-init, # Ditto
65
+
cppcoreguidelines-pro-type-reinterpret-cast, # Sadly, for binary compatibility and performance reason, we have to use reinterpret_cast very often. But I know what I'm doing and you don't have to worry about it.
66
+
cppcoreguidelines-pro-type-static-cast-downcast, # No dynamic_cast allowed anywhere in NH3API
67
+
cppcoreguidelines-pro-type-union-access, # We can't avoid unions because of the binary compatibility, also std::variant is really poorly designed
68
+
cppcoreguidelines-pro-type-vararg, # You can potentially get rid of the C-style va_args but this may disrupt the calling convention
69
+
cppcoreguidelines-virtual-class-destructor, # NH3API can't define virtual destructors by design, it uses scalar_deleting_destructor for binary compatibility. Also you must NOT allocate and deallocate the game polymorphic types with the standard new/delete in your code, use NH3API overloads with exe_heap, which map to the appropriate .exe new/delete
70
+
performance-enum-size, # In NH3API, the choice for the underlying type for enums often depends on where the enum is used. I pick the most optimal size for every single enum, especially when it oftens used/fits into a few variables of some structures. If the enum is not used in any structures as type of a member variable, I pick either uint32_t for flag enums or int32_t/uint32_t for other enums based on whether or not the negative values make sense, often for checks or their lack thereof
71
+
performance-no-int-to-ptr, # NH3API uses too many uintptr_t-to-pointer conversions for readability and performance, we can't just avoid it. The whole library is kind of built around fixed addresses in the .exe binary
72
+
readability* # Absolutely incompatible with NH3API
ArgumentLists: Delimiters # The default is FullPlaceholders, which inserts the function with a signature, including the types, which is ridiculous
83
+
HeaderInsertion: Never # Never insert any headers automatically to make use of as least dependencies as possible
84
+
CodePatterns: None # The idea itself is not that bad, the problem is that you have to either disable this option completely, or get used to annoying specific parts of the feature(like if...else if part, it drove me insane!)
49
85
86
+
# Inlay Hints make it difficult to write and edit the code, also since the argument names frequently are the same as parameter names, these are just an overkill
50
87
InlayHints:
51
88
BlockEnd: true
52
89
ParameterNames: false
@@ -55,4 +92,4 @@ InlayHints:
55
92
DefaultArguments: false
56
93
57
94
Hover:
58
-
ShowAKA: true
95
+
ShowAKA: true# One of the most useful features of clangd! Helpful, excellent, simple
0 commit comments