--- Log opened Fri May 17 00:00:15 2019 01:39 -!- dgpv [~dgpv@static.219.30.99.88.clients.your-server.de] has joined #secp256k1 01:42 < dgpv> a bit offtopic, but re alignof(): here's an macro abomination to emulate alignof() that should work even if null pointer is non-zero, and even different for each type (but requires additional CALC_ALIGNOF(type) for each type you need to use with alignof(type)): https://0bin.net/paste/C6MkKKr70G0BOJAy#poT+81NoGfz8ZmppwWpUsT5kYDej0Kid5upRVgURteI 01:43 < dgpv> I lurk here via public channel logs and was intrigued if you can do this at all, so decided to give it a shot... 01:59 < dgpv> probably __alignof_ is not the best prefix to use, bc it might conflict with some compiler-specific things but this is just an example, not for production use :-) 02:00 < dgpv> but if you have compiler-specific things along the lines of __alignof__ then you better use them.. 02:32 -!- dgpv [~dgpv@static.219.30.99.88.clients.your-server.de] has quit [Quit: dgpv] 03:00 -!- arubi [~ese168@gateway/tor-sasl/ese168] has quit [Remote host closed the connection] 03:00 -!- arubi [~ese168@gateway/tor-sasl/ese168] has joined #secp256k1 06:05 < real_or_random> yeah, this looks clever even though it's even more hackish 06:05 < real_or_random> idk, to be honest, we don't actually need this in secp256k1. it's just interesting to think about it. 06:11 < real_or_random> I think C (before C11) is just not very useful to the user here who wants to have manual control over memory. "you get UB if you perform an unaligned access but we don't tell you what the correct aligment for a type is" 09:21 < roconnor> At the risk of staying off topic, I haven't figured out how to use align_of in a way that is both useful but not already UB. 09:22 < roconnor> s/UB/unportable/ 10:15 < gmaxwell> There is a big difference between UB and unportable/implementation-defined, however. 14:06 < real_or_random> roconnor: say you get some memory object and want to store a short and an int in it. then you may need to align the int manually. 14:06 < real_or_random> (good programmers will use a struct, so I'm not convinced that this example makes sense^^) --- Log closed Sat May 18 00:00:17 2019