logoalt Hacker News

cozzyd12/09/20243 repliesview on HN

I'm curious about the #ifdef guard, which is of a form I've never encountered.

  #ifndef BD9DF82A4540BB19368E48E4747C0706
  #define BD9DF82A4540BB19368E48E4747C0706
Does some IDE do that for you? Did you just pick a random sequence? Why not just a variant of #ifndef _salmagundi_h that is more common?

Other than that, I strongly echo other's advice about avoiding so many mallocs.


Replies

quotemstr12/09/2024

Amazing how hard some people try to avoid the obviously correct and portable "#pragma once".

show 2 replies
tobyhinloopen12/09/2024

What's wrong with `#pragma once`? (honest question, i only do C and C++ as a hobby)

show 4 replies
heavensteeth12/09/2024

It's the length of an MD5 hash, which I'd wager isn't a coincidence. It's not "salmagundi", "Salmagundi", or "salmagundi.h" though.