Shafik Yaghmour
@shafik.bsky.social
960 followers 240 following 630 posts
Compiler Engineer clang front end. Interests: C++, C, and undefined behavior. Martial Artist, Book Worm and Dad. he/him Mastodon: https://hachyderm.io/@shafik Blog: https://shafik.github.io/ #cplusplus #compilers
Posts Media Videos Starter Packs
Pinned
C++ quiz #302

Answer here: hachyderm.io/@shafik/1151...

#Cplusplus
#Cpppolls
#302 Given the following in C++ 

struct S {
    void f(int);
  private:
    void f(double);
  };

  void g(S* sp) {
    sp->f(2); // Does overload resolution
    // work even though f(double) is private? 
  }

Without checking:

A. Yes
B. No
Reposted by Shafik Yaghmour
#15 Spooky Halloween C++

👻🎃👻🎃👻🎃👻🎃👻🎃

On Halloween a parent ask their child what their favorite character in class was today

🐢
🐢

The kid said "char mutable teenage_ninja_turtle;"

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
Reposted by Shafik Yaghmour
#14 Spooky Halloween C++

👻🎃👻🎃👻🎃👻🎃👻🎃

How do you scare a C++ dev who is also an environmentalist

🚗
🚙

Almost Always Auto

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
Reposted by Shafik Yaghmour
#13 Spooky Halloween C++

👻🎃👻🎃👻🎃👻🎃👻🎃

What was the werewolf's favorite feature?

🐺
🐺

pack expansions

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
Reposted by Shafik Yaghmour
#12 Spooky Halloween C++

👻🎃👻🎃👻🎃👻🎃👻🎃

What was the werewolf's least favorite storage class?

🐺
🐺

static

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
Retro C++ quiz #42 vector cast?

Answer here: hachyderm.io/@shafik/1153...

#CppPolls
#cplusplus
Retro C++ quiz #42

Given the following in C++:

#include <vector>

void f() {
  (std::vector<float>)(5,2);
}

Without checking, is the code:

A. Well-formed
B. Ill-formed
C. Undefined Behavior
Reposted by Shafik Yaghmour
#10 Spooky Halloween C++.

👻🎃👻🎃👻🎃👻🎃👻🎃

What C++ features are devils and demons looking forward to the most?

👹
👺

Contracts and assumptions

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
"A small number of samples can poison LLMs of any size": www.anthropic.com/research/sma...

Black hats have to be trying (Why wouldn't they, the potential gains are large). If it's really this easy then likely malicious code is already making its way into real code bases, maybe at scale.

😱

#ai
In a joint study with the UK AI Security Institute and the Alan Turing Institute, we found that as few as 250 malicious documents can produce a "backdoor" vulnerability in a large language model—regardless of model size or training data volume. Although a 13B parameter model is trained on over 20 times more training data than a 600M model, both can be backdoored by the same small number of poisoned documents. Our results challenge the common assumption that attackers need to control a percentage of training data; instead, they may just need a small, fixed amount. Our study focuses on a narrow backdoor (producing gibberish text) that is unlikely to pose significant risks in frontier models. Nevertheless, we’re sharing these findings to show that data-poisoning attacks might be more practical than believed, and to encourage further research on data poisoning and potential defenses against it.
Reposted by Shafik Yaghmour
#9 Spooky Halloween C++

👻🎃👻🎃👻🎃👻🎃👻🎃

What potential C++ feature do vampires find least useful?

👻
👻

Reflection

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
Reposted by Shafik Yaghmour
#8 Spooky Halloween C++


👻🎃👻🎃👻🎃👻🎃👻🎃


Why are the input characters afraid of the Lexer?


👻
👻


They heard about maximal munch!


👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
I got to use vestigial in a review today 🧐
Reposted by Shafik Yaghmour
#7 Spooky Halloween C++.

👻🎃👻🎃👻🎃👻🎃👻🎃

What are a ghosts favorite types?

👻
👻

bool and float

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
Reposted by Shafik Yaghmour
#6 Spooky Halloween C++.

👻🎃👻🎃👻🎃👻🎃👻🎃

What is a vampires favorite type?

👻
👻

std::byte

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
Reposted by Shafik Yaghmour
#5 Spooky Halloween C++.

👻🎃👻🎃👻🎃👻🎃👻🎃

Why did Igor make a bad C++ dev?

👻
👻

He keeps trying to throw the switch

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
Reposted by Shafik Yaghmour
#4 Spooky Halloween C++.

👻🎃👻🎃👻🎃👻🎃👻🎃

Why don't mummies use exceptions?

👻
👻

Because they are afraid of unwinding

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
C++ Retro quiz #41

Answer here: hachyderm.io/@shafik/1153...

#CppPolls
#cplusplus
Retro C++ quiz #41

Given the following in C++:

struct B {
 int x:4;
};

void f(int &x);

void b() {
 B b1{1};

 auto &[y] = b1; // A 
 y = 5; // B
 f(y); // C
}

Without checking, the code is ill-formed (requires a diagnostic) at point:

A. A 
B. B
C. C
Reposted by Shafik Yaghmour
#3 Spooky Halloween C++.

👻🎃👻🎃👻🎃👻🎃👻🎃

Why are C++ devs bad at halloween?

👻
👻

Because they all come wearing bit-masks

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
Reposted by Shafik Yaghmour
#2 Spooky Halloween C++.

👻🎃👻🎃👻🎃👻🎃👻🎃

Why don’t the undead make good C++ programmers?

👻
👻

Because they don’t know how to end their lifetimes properly.

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
Folks just assume they are right and get mad when I tell them know that is not right.

It is a lot more work to dig up the reputable sources that shows how wrong it is than for folks to just accept what the summary says.

This is direly bad for society.
I have now been experiencing folks using LLM summaries to answer question and often they get the very high level stuff correct but get details that are important but maybe have less content or are controversial and therefore have a lot of just wrong information out there wrong.
#1 Spooky Halloween C++

👻🎃👻🎃👻🎃👻🎃👻🎃

How do you curse an int?

👻
👻

You cast a hex on it:

int x = static_cast(0xB00);

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
"Other Countries Have Better Election Laws": www.electoral-vote.com/evp2025/Item...

- Ban All Corporate Campaign Donations:

- Limit Campaign Length

- Put Spending Caps in Place

- Have Campaigns Be Paid for With Public Funds

- Mandatory Voting
Other Countries Have Better Election Laws
Click on the map for the article
www.electoral-vote.com