Re: [PATCH v3 3/5] config: make parsing stack struct independent from actual data source

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 09, 2013 at 06:19:32PM +0200, Heiko Voigt wrote:

> diff --git a/config.c b/config.c
> index 046642b..2390458 100644
> --- a/config.c
> +++ b/config.c
> @@ -10,20 +10,41 @@
>  #include "strbuf.h"
>  #include "quote.h"
>  
> -typedef struct config_file {
> -	struct config_file *prev;
> -	FILE *f;
> +struct config_source {
> +	struct config_source *prev;
> +	union {
> +		FILE *file;
> +	};

Anonymous unions like this are a C11-ism (I don't know when gcc learned
about them, but I am sure that many of the older compilers we support
would not be happy). You have to do:

  union {
          FILE *file;
  } u;

and access the file as "cf->u.file".

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]