* #include <stdlib.h>
* #include <ccan/alignof/alignof.h>
*
+ * // Output contains "ALIGNOF(char) == 1"
+ * // Will also print out whether an onstack char array can hold a long.
* int main(int argc, char *argv[])
* {
* char arr[sizeof(int)];
*
+ * printf("ALIGNOF(char) == %zu\n", ALIGNOF(char));
* if ((unsigned long)arr % ALIGNOF(int)) {
* printf("arr %p CANNOT hold an int\n", arr);
* exit(1);
* macro or constant.
*
* Example:
+ * // Outputs "Initialized 32 values"
* #include <ccan/array_size/array_size.h>
* #include <stdlib.h>
+ * #include <stdio.h>
*
* // We currently use 32 random values.
* static unsigned int vals[32];
*
- * static void init_values(void)
+ * int main(void)
* {
* unsigned int i;
* for (i = 0; i < ARRAY_SIZE(vals); i++)
* vals[i] = random();
+ * printf("Initialized %u values\n", i);
+ * return 0;
* }
*
* License: LGPL (2 or any later version)
* #include <stdio.h>
* #include <stdlib.h>
*
+ * // Given IHATEMATH outputs 0x98a3b8df
* int main(int argc, char *argv[])
* {
* if (argc != 2) {