1234567891011121314151617181920212223242526272829303132 |
- /* simple test compilation */
- #include <stdio.h>
-
- struct hello_struct {
- char *buffer_field;
- };
-
- typedef struct hello_struct hello_typedef;
-
- static void echo1(struct hello_struct hello_struct_echo1)
- {
- char *echo1_nouse = NULL;
- printf("%s\n", hello_struct_echo1.buffer_field);
- }
-
- static char echo2(struct hello_struct *hello_struct_echo2)
- {
- return (char)printf("%s\n", hello_struct_echo2->buffer_field);
- }
-
- int main(void)
- {
- static char buffer [] = "hello, world\n";
- struct hello_struct hello_struct_obj = { .buffer_field = buffer, };
- printf("%s\n", buffer);
- echo1(hello_struct_obj);
- echo2(&hello_struct_obj);
- return 0;
- }
|