The surprising struggle to get a UNIX Epoch time from a UTC string in C or C++ So how hard could it be. As input we have something like Fri, 17 Jan 2025 06:07:07 in UTC, and we’d like to turn this into 1737094027, the notional (but not actual) number of seconds that have passed since 1970-01-01 00:00:00 UTC. Trying to figure this out led me to discover many ‘surprise features’ and otherwise unexpe
I was talking with someone today that really really wanted the sqrtps to be used in some code they were writing. And because of a quirk with clang (still there as of clang 18.1.0), if you happened to use -ffast-math clang would butcher the use of the intrinsic. So for the code: __m128 test(const __m128 vec) { return _mm_sqrt_ps(vec); } Clang would compile it correctly without fast-math: test: # @t
Overview¶ {fmt} is an open-source formatting library providing a fast and safe alternative to C stdio and C++ iostreams. Thanks for creating this library. It’s been a hole in C++ for a long time. I’ve used both boost::format and loki::SPrintf, and neither felt like the right answer. This does. Format API¶ The format API is similar in spirit to the C printf family of function but is safer, simpler
There’s a trend of building services where a monolithic application is better suited, or using JavaScript and Python then being stumped by their troublesome deployment story. This leads to solutions like bundling an entire web browser with an application, or using containers to circumscribe a sprawling dependency tree made of mystery meat. My small development distribution for Windows, w64devkit,
Stable: v1.7.5 / Roadmap High-performance inference of OpenAI's Whisper automatic speech recognition (ASR) model: Plain C/C++ implementation without dependencies Apple Silicon first-class citizen - optimized via ARM NEON, Accelerate framework, Metal and Core ML AVX intrinsics support for x86 architectures VSX intrinsics support for POWER architectures Mixed F16 / F32 precision Integer quantization
C/C++でプログラムを書いているときに遭遇する厄介なバグの一つがメモリリークです。 今回はメモリリークを検出するのに使えるツールの使い方について書きます。 AddressSanitizer コンパイルオプションをつけるだけで使えて出力も見やすいのでおすすめです。 AddressSanitizerはGCC 4.8以降かLLVM 3.1以降で使うことができます。 コンパイル時にオプションをつけるだけでメモリリークを検出してくれます。(若干実行時間が長くなります) 以下のメモリリークのあるプログラム leak.cpp を例に使い方を説明します。 int main() { int *a = new int[10]; } newで作った動的配列をdeleteしていないのでメモリリークになります。 g++ -fsanitize=address -fno-omit-frame-pointer -g l
Note: this document is no longer the definitive source for this information. Please see the official documents in the WG21 and WG14 document registers for the latest information. Title: C xor C++ Programming WG21 Document Number: P2735R0 WG14 Document Number: N3065 Date: 2022-12-05 Author, Affiliation: Aaron Ballman <aaron@aaronballman.com>, Intel Audience: SG22 C and C++ Compatibility Study Group
(Disclaimer: Some of this post discusses projects from my job. All opinions and mistakes here are my own.) This is a set of notes on getting to deterministic builds in C, C++ and Rust on Windows. The primary motivation for this is not the lofty goal of a Reproducible Build, but simply improving our Bazel cache hit rates. A Quick primer on Bazel caching At Dropbox, much of our build is powered by B
TL;DR Prefer f(void) in C to potentially save a 2B instruction per function call when targeting x86_64 as a micro-optimization. -Wstrict-prototypes can help. Doesn’t matter for C++. The ProblemWhile messing around with some C code in godbolt Compiler Explorer, I kept noticing a particular funny case. It seemed with my small test cases that sometimes function calls would zero out the return registe
C/C++の静的解析は、どう考えても大変なんだけどどう考えても需要が高いので、やはり色々なソフトウェアや事例があるようだ。まとまった情報が欲しいけど見つからなかったので自分の調べた範囲でまとめることにした。 他にも耳寄りな情報があったら教えてほしい。 静的解析を行うことができるソフトウェア 調べてみると結構たくさんある。それぞれの特徴とかあまりよくわからない。 (個人的には、とりわけ網羅的な形式的検証ができるツールの性能に興味があるので、それを中心に集めていたが、やはり網羅的とは限らないで探すともっとたくさん見つかるようだ。もちろん網羅性にはトレードオフがある) Frama-C …… C言語に形式手法を適用するための汎用のフレームワークで、静的検証のためのプラグインも多数(WPとかValueとか)存在する。網羅的な検証から発見的な手法、動的な手法まで様々ある。研究で使うのに便利そう Ast
TL;DR: we have discovered XMPP (Jabber) instant messaging protocol encrypted TLS connection wiretapping (Man-in-the-Middle attack) of jabber.ru (aka xmpp.ru) service’s servers on Hetzner and Linode hosting providers in Germany. The attacker has issued several new TLS certificates using Let’s Encrypt service which were used to hijack encrypted STARTTLS connections on port 5222 using transparent MiT
So that’s it, you read this article, and this post, and this, and this, and you spent too many time trying to debug 8 pages long compilation error messages, and you also spent hours trying to follow your code path involving operator overloading, copy constructors, and virtual class methods called from constructors or whatnot. You have had enough of it. Yout think it’s time for you to stop using C+
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く