Better HN
topnewbestaskshowjobs
Log inSign up

fpotier

3 karma · joined Dec 9, 2025 (11mo ago) · 3 submissions

Submissions

comment 3mo ago · link · parent

The account targeted doesn't seem to be a real person at all

comment 11mo ago · link · parent

void employee_set_age(struct Employee* employee, int newAge) { // Cast away the const and set it's value, the compiler should optimize this for you (int)&employee->age = newAge; }

I believe that "Casting away the const" is UB [1]

[1]: https://en.cppreference.com/w/c/language/const.html