[minicoredumper] Building minicoredumper_demo/main.c fails

John Ogness john.ogness at linutronix.de
Tue May 9 09:32:19 CEST 2017


On 2017-04-24, Anders Wallin <wallinux at gmail.com> wrote:
> If configure is run with "--with-minicoredumper_demo" the build will
> fail due to missing typecasts.

Actually, these errors were intentional. The demo is not particularly
interesting as a runtime example. It is more interesting for developers
as an API example. Part of that example was to demonstrate that each
pointer argument is typecasted based on the length modifier and
conversion specifier associated with that argument.

Whenever I want to compile the demo program
(--with-minicoredumper_demo), I also add --without-werror. I _want_ to
see those warnings as it is proof for me that the automatic type
checking is working.

Perhaps I should modify main.c like this? Any thoughts?

John Ogness


--- a/src/minicoredumper_demo/main.c
+++ b/src/minicoredumper_demo/main.c
@@ -62,6 +62,10 @@ int __attribute__((optimize("O0"))) main(int argc, char *argv[])
 	*val3 |= (unsigned long)0x6abc123a << 32;
 #endif
 
+#warning The following code includes intentional warnings to demonstrate \
+	 automatic type checking. Configure with --without-werror to \
+	 compile this code.
+
 	/* register text dumps */
 	/* "This is string 1.\n" */
 	mcd_dump_data_register_text("tdump1.txt", 6, &dd[0],




More information about the minicoredumper mailing list