File:  [MW Coherent from dump] / coherent / b / conf / patch / tiny.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:35 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

/*
 * Demonstrarte a union bug.
 */
#include <stdio.h>

typedef union {
	char	p_char;
	short	p_short;
	int	p_int;
	long	p_long;
} p_val;

main()
{
	p_val test_val;
	
	test_val.p_long = 0x11223344;

	printf("char 0x%x\n", test_val.p_char);
	printf("short 0x%x\n", test_val.p_short);
	printf("int 0x%x\n", test_val.p_int);
	printf("long 0x%x\n", test_val.p_long);

} /* main() */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.