I ran this code on 386 machine on QEMU based public VPC service. 2019年4月2日(火) 9:27 Skip Tavakkolian <skip.tavakkol...@gmail.com>: > > It should initialize to zero. 8c and 5c both do the right thing here. > > Which distribution and cputype? > > On Mon, Apr 1, 2019, 8:34 AM Kyohei Kadota <lu...@lufia.org> wrote: >> >> Hi, 9fans. I use 9legacy. >> >> About below program, I expected that flags field will initialize to >> zero but the value of flags was a garbage, ex, "f8f7". >> Is this expected? >> >> ``` >> #include <stdio.h> >> >> struct option { >> int n; >> char *s; >> int flags; >> }; >> >> int >> main(void) >> { >> struct option opt = {1, "test"}; >> printf("%d %s %x\n", opt.n, opt.s, opt.flags); >> return 0; >> } >> ``` >>
- [9fans] Don't Plan 9 C compiler initialize the rest of ... Kyohei Kadota
- Re: [9fans] Don't Plan 9 C compiler initialize the... Skip Tavakkolian
- Re: [9fans] Don't Plan 9 C compiler initialize... Kyohei Kadota
- Re: [9fans] Don't Plan 9 C compiler initialize the... Jeremy O'Brien
- Re: [9fans] Don't Plan 9 C compiler initialize... Charles Forsyth
- Re: [9fans] Don't Plan 9 C compiler initialize... Kurt H Maier
- Re: [9fans] Don't Plan 9 C compiler initia... Dan Cross
- Re: [9fans] Don't Plan 9 C compiler in... Kurt H Maier
- Re: [9fans] Don't Plan 9 C compil... Skip Tavakkolian
- Re: [9fans] Don't Plan 9 C co... David du Colombier
- Re: [9fans] Don't Plan 9 C compil... Charles Forsyth
- Re: [9fans] Don't Plan 9 C co... Anthony Martin
- Re: [9fans] Don't Plan 9 ... Charles Forsyth