#Pragma

2025-06-20

Here’s another roundup of Swift/iOS conferences in Europe later this year. I’m planning to be at SwiftLeeds and #Pragma.

2025-06-15

@zeux @pervognsen fun fact: on RISC-V, the amount of intrinsics for the vector extension would be through the roof due to combinatorial explosion, but they employ

#pragma riscv intrinsic "vector"
(sans quote marks in Clang)

to have the compiler instantiate them all internally. Arm partially employs that tactic too

as a downside, one no longer can fish out intrinsics from installed headers (not to imply that someone would try that on RISC-V)

gcc.gnu.org/cgit/gcc/tree/gcc/

2025-06-10

huh, so it was something to do with my #ifndefs. gcc really really didn't like them.

Replaced them with #pragma once and absolutely no red squiggles now.

Man, I haven't used C++ in ages.

うぃまるwimaru
2025-05-30

私が学生時代に習ってたコードって

'''
onceすら使わない地獄の化石コードだったんよね………
'''

nightshade systemnightshade@elekk.xyz
2025-05-12

`#pragma no_bugs`

Top Ten Things Overheard At The ANSI C Draft Committee Meetings:

10: Sorry, but that's too useful.
9: Dammit, little-endian systems *are* more consistent!
8: I'm on the committee and I *still* don't know what the hell
#pragma is for.
7: Well, it's an excellent idea, but it would make the compilers too
hard to write.
6: Them bats is smart; they use radar.
5: All right, who's the wiseguy who stuck this trigraph stuff in here?
4: How many times do we have to tell you, "No prior art!"
3: Ha, ha, I can't believe they're actually going to adopt this sucker.
2: Thank you for your generous donation, Mr. Wirth.
1: Gee, I wish we hadn't backed down on "noalias".

hashtag #pragma and hashtag #define
Jyrki :paw_nonbinary:nilsding@pounced-on.me
2025-05-01

@Ninji maybe i should start adding #pragma no_bugs to my C++ source files, if AI can do it so can gcc

2025-04-26

@aeva `#pragma GCC optimize("-O0")`

*holds up a sign that says `#pragma optimize("", off)` above you*

:3

Just had to wrap a function in #pragma GCC optimize ("O0") because otherwise gcc was failing to compile my inline asm 🤦‍♂️

Jevin Swevaljevinskie
2025-04-11

How to politely use assert in a header (gcc/clang/msvc/what else?):

push_macro("NDEBUG")
NDEBUG
<assert.h>
// your asserts should properly assert
pop_macro("NDEBUG")
// nobody has 2 know

Your vendor’s assert.h should be able to be included multiple times with NDEBUG defined or not.

2025-04-08

RealProbe: An Automated and Lightweight Performance Profiler for In-FPGA Execution of High-Level Synthesis Designs

Jiho Kim, Cong Hao
arxiv.org/abs/2504.03879 arxiv.org/pdf/2504.03879 arxiv.org/html/2504.03879

arXiv:2504.03879v1 Announce Type: new
Abstract: High-level synthesis (HLS) accelerates FPGA design by rapidly generating diverse implementations using optimization directives. However, even with cycle-accurate C/RTL co-simulation, the reported clock cycles often differ significantly from actual FPGA performance. This discrepancy hampers accurate bottleneck identification, leading to suboptimal design choices. Existing in-FPGA profiling tools, such as the Integrated Logic Analyzer (ILA), require tedious inspection of HLS-generated RTL and manual signal monitoring, reducing productivity. To address these challenges, we introduce RealProbe, the first fully automated, lightweight in-FPGA profiling tool for HLS designs. With a single directive--#pragma HLS RealProbe--the tool automatically generates all necessary code to profile cycle counts across the full function hierarchy, including submodules and loops. RealProbe extracts, records, and visualizes cycle counts with high precision, providing actionable insights into on-board performance. RealProbe is non-intrusive, implemented as independent logic to ensure minimal impact on kernel functionality or timing. It also supports automated design space exploration (DSE), optimizing resource allocation based on FPGA constraints and module complexity. By leveraging incremental synthesis and implementation, DSE runs independently of the original HLS kernel. Evaluated across 28 diverse test cases, including a large-scale design, RealProbe achieves 100% accuracy in capturing cycle counts with minimal logic overhead-just 16.98% LUTs, 43.15% FFs, and 0% BRAM usage. The tool, with full documentation and examples, is available on GitHub.

Paul Haddad :tapbots_logo:paul@tapbots.social
2025-04-07

I feel kind of stupid for never thinking of doing this before, makes finding blocks of code with #pragma mark so much easier.

Johanna Wilder, “Go ’Phins!” 🐬jiejie
2025-03-24

I do not care about benchmarks and last exams.

4o is a coding beastie.

Hey, pal, this crap out in Swiftie style:

Bazinga! goes the GPU!

image of ChatGPT adding conditionals to the debug version, so they don't leak into release
2025-03-22

@eniko does #pragma warning (disable etc) not respect the color highlighting?

2025-03-09

@flyingsaceur

#pragma once

Excuse me?

2025-02-24

#pragma once, shame on... shame on you
#pragma you can't get pragged again

Cato, registered LynxⓁcato@chaosfurs.social
2025-01-30

the IAR C compiler allows DECREASING the optimization level with a #pragma, but not INCREASING

like, I can't have my code compile without optimizations except for a specific critical function that should be optimized. what the fuck were they thinking

#c #programming

C header files usually have a guard to prevent them being included more than once. Quite often these take the form of

#ifndef THING

#define THING

/* Header content. */

#endif

Where THING is loosely derived from the filename itself.

I now prefer this at the top of the file:

#pragma once

And none of the rest of that boilerplate.

It's not standard but supported by all compilers I tried. If you know of corner cases where this doesn't work, I'd like to hear from you 🙂

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst