--- Log opened Sun Mar 31 00:00:31 2019 00:52 -!- harding [~quassel@li1258-130.members.linode.com] has quit [Ping timeout: 240 seconds] 00:58 -!- harding [~quassel@li1258-130.members.linode.com] has joined #secp256k1 01:21 -!- sipa [~pw@gateway/tor-sasl/sipa1024] has quit [Remote host closed the connection] 01:27 -!- sipa [~pw@gateway/tor-sasl/sipa1024] has joined #secp256k1 03:40 < real_or_random> roconnor: I had a discussion with nickler about the scratch API two weeks ago https://github.com/bitcoin-core/secp256k1/pull/600#issuecomment-473929444 03:43 < real_or_random> it's at least not clear from the docs in the header, so you're not the only one who is confused 03:45 < real_or_random> see also https://github.com/bitcoin-core/secp256k1/pull/600#pullrequestreview-214519378 03:47 < real_or_random> have I said how stupid C is: you get UB if the alignment is wrong but there is no way to figure out the required alignment 03:49 < real_or_random> (except for alignof in C11, or the incredible beautiful construct "#define alignof(type) ((size_t)&((struct { char c; type d; } *)0)->d)") 03:51 < gmaxwell> even better, unaligned accesses usually work on many platforms... so tests won't fail if you mess it up, usually. 03:52 < real_or_random> yeah UB doesn't exclude the behavior that you had in mind :D 03:53 < real_or_random> no, seriously, it's hard to test. I tried that in the prealloc PR but it's not really doable 03:55 < gmaxwell> it can be useful to test on platforms that blow up nicely on unaligned accesses... older arm arches were nice, since the lsb of addresses was used to trigger byte swapping. 03:56 < gmaxwell> I should probably dig up the itanium2 ... it traps on unaligned access. 04:01 < real_or_random> the fun thing is that you can use a flag to force x86 to trap on unaligned access but it won't help you because you can't convince the compiler to generated only aligned accesses 04:02 < real_or_random> https://github.com/bitcoin-core/secp256k1/pull/566#issuecomment-434038197 04:03 < gmaxwell> yeah, I knew that was useless. on real platforms where unaligned isn't permitted the compiler won't produce them. 04:05 < gmaxwell> alpha also traps on unaligned access. I've got one of those somewhere too... 07:06 < roconnor> I wonder if [Cerberus](http://cerberus.cl.cam.ac.uk/cerberus) will warn you about unaligned access. 07:18 < roconnor> real_or_random: your "see also" link points to a conversation that is basically identical to what I had in my head after talking with sipa. 18:58 -!- Cory [Cory@unaffiliated/cory] has quit [] 19:25 -!- Cory [~Cory@unaffiliated/cory] has joined #secp256k1 --- Log closed Mon Apr 01 00:00:32 2019