Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Jani Nikula
Jani Nikula
@jani@floss.social  ·  activity timestamp 3 weeks ago

Decades of C programming, and I guess by pure luck I don't think I've encountered this gotcha before:

You can't have function pointer struct members named anything that collides with a macro name.

You can define them, but they'll be difficult to call, requiring a proxy variable.

Since the C standard allows many of the standard library interfaces to be defined as either a function or a macro, all of them are best avoided.

E.g. p->isalnum(c) might or might not work, depending on includes.

#C

  • Copy link
  • Flag this post
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.2-alpha.23 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct