-
cmake+ justfile (C++23&26 build)
-
gcc ์ต์ ๋ฒ์ ผ ๋ค์ด ๋ฐ๊ธฐ_& gcc ์ต์ ์ ๋ณด
- (์ธ๋ถ๋งํฌ) gcc ์ต์ ๋ฒ์ ผ ๋ค์ด ๋ฐ๊ธฐ_์ ์ค๋ช
๋จ
- ์ต์ ํ ์๋ ์ค์น
- (์ธ๋ถ๋งํฌ) gcc ์ต์ ๋ฒ์ ผ ๋ค์ด ๋ฐ๊ธฐ_์ ์ค๋ช
๋จ
-
-std=c++2b
๊ฐ์๊ฑฐ_์ปดํ์ผ์ต์ ์ ๋ฆฌ ๋ฒ์ ผ๋ณc++20+23+26 & C/C++ Support in Clang -
C++26
-
์ธ๊ตญ์ฌ๋์ด ์ ์ ๋ฆฌํจ(C11๋ถํฐ C26๊น์ง ์์ ์ ์ ๋ฆฌ๋จ)
-
C++ 23
-
Cpp practices
-
C++26์ดํ ์ต์ ๋ด์ค ๋ชจ์
-
C++๋ฒ์ ผ๋ณ ์ญ์ฌ ๋ฐ ์ ๋ฆฌ ์๋จ
CPLUS_INCLUDE_PATH
์ด๊ฑธ ํด์ค์ผ C++26์ด ๋๋ค.|๐|
export CPLUS_INCLUDE_PATH=$PREFIX/$HOST/include/c++/$GCCVERSION:$PREFIX/lib/gcc/$HOST/$GCCVERSION/include
- fishshell
set -x CPLUS_INCLUDE_PATH "$PREFIX/$HOST/include/c++/$GCCVERSION:$PREFIX/lib/gcc/$HOST/$GCCVERSION/include"
gcc15์ต์ ํ ๋ค ์ค์นํ๊ณ gcc-15 default๋ก ๋ง๋ค๊ธฐ|๐|
sudo update-alternatives --install /usr/bin/gcc gcc /opt/gcc-15/bin/gcc 100
sudo update-alternatives --install /usr/bin/g++ g++ /opt/gcc-15/bin/g++ 100
cmake ์ต์ ํ ์ค์น|๐|
- https://cmake.org/download/
- ์์ถ ํ๊ณ cmakeํด๋ ๋ค์ด๊ฐ์
./bootstrap && make && sudo make install
Cmake์ ๋ฐ์ดํธ ํ๊ธฐ[๐]
Cmake option์ต์ ์ค์ [๐]
C++ 26์ต์ ๋ด์ค ๋ชจ์|๐|
- 250428
- GCC 15๋ C++26 ๊ธฐ๋ฅ์ ๋๊ฑฐ ์ถ๊ฐํ์ผ๋ฉฐ, ์ผ๋ถ C++23 ๊ธฐ๋ฅ๋ ๊ฐ์ ํ์
- ์ฃผ์ ์ถ๊ฐ ๊ธฐ๋ฅ์ Pack Indexing, Variadic Friends, ์ญ์ ์ด์ ๋ช ์, ๊ตฌ์กฐ์ ๋ฐ์ธ๋ฉ ์กฐ๊ฑด๋ฌธ ๋ฑ
- ์๋ก์ด ์ปดํ์ผ๋ฌ ์ต์ ๊ณผ ๊ฒฝ๊ณ ๋ค๋ ๋์ ๋์ด ๊ฐ๋ฐ์ ๊ฒฝํ์ด ํฅ์๋จ
- C++ ๋ชจ๋ ์ง์์ด ๊ฐํ๋์๊ณ , ํ ํ๋ฆฟ ์ปดํ์ผ ์โฆ
gcc์ต์ ์ ๋ณด ๋ฐ ๋ค์ด๋ก๋ ๋ฐ๊ธฐ|๐|
-
gcc-15.1.0(Fri Apr 25 10: 36 :04 GMT 2025)
-
gcc15์ต์ ๋ฒ์ ผ ์ค์น๋ฐฉ๋ฒ(250731)
-
gcc14๋ฒ์ ผ ์ค์น๋ฐฉ๋ฒ
์ต์ LLVM์ค์น(clang)|๐|
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh <version number>
clang-format-20
์ค์น๋ฐฉ๋ฒ|๐|
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 20
sudo apt install clang-format-20
- ๋ค๋ฅธ ๋ฐฉ๋ฒ
$ cmake -S llvm -B build -G Ninja \
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi" \
-DLLVM_USE_LINKER=mold \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++
$ cd build
$ cmake --build . --target install
GDB Tutorial|๐|
- Gdb is a debugger for C (and C++). It allows you to do things like run the program up to a certain point then stop and print out the values of certain variables at that point, or step through the program one line at a time and print out the values of each variable after executing each line. It uses a command line interface.
C++26: The Next C++ Standard | by Rainer Grimm์ด ์ฌ๋์ด ์ต๊ณ |๐|
- August 19, 2024/0 Comments/in C++26/by Rainer Grimm
Code Generation in Rust vs C++26 | Posted Sep 30, 2024 Updated Oct 4, 2024 | By Barry Revzin|๐|
C++23 tutorial|๐|
C++ Weekly - Ep 323 - C++23's auto{} and auto()
gcc command
g++ -std=c++2b -Wpedantic -Wall -Wextra -Wconversion -O3 -Werror -o main main.cpp
./main
C++23|๐|
https://en.m.wikipedia.org/wiki/C%2B%2B23
C++23 Standard Library Preview - Jeff Garland - CppCon 2021|๐|
Despite the pandemic the C++ committee is continuing to work towards C++23. This survey presentation provides students with a broad overview of the changes and new facilities in the C++23 standard library.
Compiler Explorer__web coding|๐|
CppCon|๐|
https://github.com/CppCon/CppCon2023
https://github.com/CppCon/CppCon2022
https://github.com/CppCon/CppCon2021
https://github.com/CppCon/CppCon2020
https://github.com/CppCon
C++23|๐|
https://www.modernescpp.com/index.php/ranges-improvements-with-c-23
https://en.cppreference.com/w/cpp/23
C++ 23 Forum|๐|
https://cplusplus.com/forum/lounge/283965/
C++ Core Guidelines|๐|
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
C/C++ Support in Clang|๐|
- Clang implements the following published and upcoming ISO C++ standards:
Language Standard | Flag | Available in Clang? |
---|---|---|
C++2c C++26 |
-std=c++2c | Partial |
C++23 | -std=c++23 -std=c++2b |
Partial |
C++20 | -std=c++20 -std=c++2a |
Partial |
C++17 | -std=c++17 | Clang 5 |
C++14 | -std=c++14 | Clang 3.4 |
C++11 | -std=c++11 | Clang 3.3 |
C++98/C++03 | -std=c++98 | Yes (other than export) |
GNU 89 | none, -std=gnu89 | |
ANSI, ISO C90 | -ansi, -std=c89 | |
ISO C99 | -std=c99 | |
ISO C11 | -std=c11 |
- (CS)์ปดํจํฐ ์์คํ [ 3ํ ] ๊นํ์ ์ | ํผ์คํธ๋ถ | 2016๋ 09์ 06์ผ(p35)
GCC / Clang|๐|
-Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic
- use these and consider the following (see descriptions below)
-
-lm
- ํ์ํ๋ค๋ฉด ํ์ค ์ํ ํจ์๋ฅผ ์ถ๊ฐํ๋ค. -
-pedantic
- Warn on language extensions -
-Wall -Wextra
reasonable and standard -
-Wshadow
warn the user if a variable declaration shadows one from a parent context -
-Wnon-virtual-dtor
warn the user if a class with virtual functions has a non-virtual destructor. This helps catch hard to track down memory errors -
-Wold-style-cast
warn for c-style casts -
-Wcast-align
warn for potential performance problem casts -Wunused warn on anything being unused -
-Woverloaded-virtual
warn if you overload (not override) a virtual function -
-Wpedantic
(all versions of GCC, Clang >= 3.2) warn if non-standard C++ is used -
-Wconversion
warn on type conversions that may lose data -
-Wsign-conversion
(Clang all versions, GCC >= 4.3) warn on sign conversions -
-Wmisleading-indentation
(only in GCC >= 6.0) warn if indentation implies blocks where blocks do not exist -
-Wduplicated-cond
(only in GCC >= 6.0) warn if if / else chain has duplicated conditions -
-Wduplicated-branches
(only in GCC >= 7.0) warn if if / else branches have duplicated code -
-Wlogical-op
(only in GCC) warn about logical operations being used where bitwise were probably wanted -
-Wnull-dereference
(only in GCC >= 6.0) warn if a null dereference is detected -
-Wuseless-cast
(only in GCC >= 4.8) warn if you perform a cast to the same type -
-Wdouble-promotion
(GCC >= 4.6, Clang >= 3.8) warn if float is implicitly promoted to double -
-Wformat=2
warn on security issues around functions that format output (i.e., printf) -
-Wlifetime
(only special branch of Clang currently) shows object lifetime issues -
-Wimplicit-fallthrough
Warns when case statements fall-through. (Included with -Wextra in GCC, not in clang)
Consider using -Weverything
and disabling the few warnings you need to on Clang
-Weffc++
warning mode can be too noisy, but if it works for your project, use it also.
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /opt/gcc-15/lib/../lib64
----------------------------------------------------------------------
Libraries have been installed in:
/opt/gcc-15/lib/../lib64
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
export CFLAGS="$CFLAGS -D__GLIBC_USE\(...\)=0"