[Patch] fix IDL hang

Noel Power nopower at suse.com
Thu Aug 7 07:00:34 MDT 2014

On 07/08/14 12:32, Jelmer Vernooij wrote:
> On Thu, Aug 07, 2014 at 12:22:59PM +0100, Noel Power wrote:
>> Hi,
>> issuing
>> ./pidl/pidl --header --ndr-parser -- foo.idl
>> will cause pidl to hang, the attached patch prevents the recursion that
>> triggers that. Note: I compared the contents of
>> bin/default/librpc/gen_ndr before and after the patch and the contents
>> are identical
> What's the reason for supporting this rather than errorring out?
well it's a simplified version of a structure I want to represent via
idl (and get the benefit of ndr generated marshall/unmarshall routines)
>  What does midl do in this case?
hmm I never used  midl before :/ trying it and it indeed does error out

Microsoft (R) 32b/64b MIDL Compiler Version 7.00.0500
Copyright (c) Microsoft Corporation 1991-2006. All rights reserved.
Processing .\foo.idl
.\foo.idl(5) : error MIDL2025 : syntax error : expecting a type
specification near "baz"
.\foo.idl(6) : error MIDL2026 : cannot recover from earlier syntax
errors; aborting compilation

but... not sure if that is a reason to be as restrictive (isn't it the
case that things that compile with midl might not compile with pidl &
vice-versa due to differences, extensions etc. )
In anycase I'd be glad to know though if there is a some other way in
idl to properly express below
>> interface foobar
>> {
>> 	typedef [public] struct {
>> 		baz anode;
>> 	} foo;
>> 	typedef [public,nodiscriminant,switch_type(uint32)] union {
>> 		[case(1)] foo afoo;
>> 	} values;
>> 	typedef [public] struct {
>> 		[switch_is(ultype)] values avalue;
>> 	} baz;
>> };
to achieve the same result, any ideas?


More information about the samba-technical mailing list