c - What does the macro _bnd(X,bnd) mean? -


recently read implement own printf use macro _bnd(x,bnd),but don't understand mean of macro.

#define _bnd(x, bnd) (sizeof(x) + (bnd) & ~(bnd)) 

i know bitwise operator , sizeof()

it's internal implementation magic, playing implementation-dependent properties of addresses of arguments variable-argument functions.

unless need know means, best stay away it. otherwise may tempt rely on it.

and macro should be

#define _bnd(x, bnd) (sizeof(x) + (bnd) & ~(bnd))              ^              check in post 

also can know expanding basic arrithmetic operation.for should know sizeof() , tilde operator , bitwise operatior.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -