9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Don't Plan 9 C compiler initialize the rest of member of a struct?
@ 2019-04-01 15:32 Kyohei Kadota
  2019-04-01 23:49 ` Skip Tavakkolian
  2019-04-02  0:26 ` Jeremy O'Brien
  0 siblings, 2 replies; 20+ messages in thread
From: Kyohei Kadota @ 2019-04-01 15:32 UTC (permalink / raw)
  To: 9fans

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;
}
```



^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2019-04-02 19:57 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-01 15:32 [9fans] Don't Plan 9 C compiler initialize the rest of member of a struct? Kyohei Kadota
2019-04-01 23:49 ` Skip Tavakkolian
2019-04-02 14:44   ` Kyohei Kadota
2019-04-02  0:26 ` Jeremy O'Brien
2019-04-02  0:35   ` Charles Forsyth
2019-04-02  0:35   ` [9fans] Don't Plan 9 C compiler initialize the rest of member of a?struct? Kurt H Maier
2019-04-02  1:20     ` Dan Cross
2019-04-02  2:22       ` Kurt H Maier
2019-04-02  3:06         ` Skip Tavakkolian
2019-04-02  8:02           ` David du Colombier
2019-04-02 10:38         ` Charles Forsyth
2019-04-02 16:25           ` Anthony Martin
2019-04-02 16:37             ` Charles Forsyth
2019-04-02 14:52   ` [9fans] Don't Plan 9 C compiler initialize the rest of member of a struct? Kyohei Kadota
2019-04-02 15:02     ` Skip Tavakkolian
2019-04-02 15:14       ` Skip Tavakkolian
2019-04-02 16:18         ` Devon H. O'Dell
2019-04-02 19:57           ` Charles Forsyth
2019-04-02 15:04     ` Charles Forsyth
2019-04-02 15:16       ` Kyohei Kadota

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).