a question about structure convert to char* in function printf/fprintf

2018-08-12 Thread zerons
Hi all, As we know, gcc would give us an error message when we do this: `struct _test a; char *s = a;`; However, when we use this in printf/fprintf, it gets wired. ```c #include struct _test { char name[256]; }; struct _test tests[100]; int main(int argc, char *argv[]) { memcp

Re: a question about structure convert to char* in function printf/fprintf

2018-08-12 Thread zerons
On 08/13/2018 03:13 AM, Jonathan Wakely wrote: On Sun, 12 Aug 2018 at 15:59, zerons wrote: Should gcc give it an error to prevent a structure from converting to char* in functions printf/fprintf? Your question is inappropriate on this mailing list, please use gcc-help next time. See https