Re: [Ctool-users] Parsing error
Brought to you by:
flisakow
|
From: Emil O. <em...@ee...> - 2002-05-13 04:37:39
|
Hi,
I think that I've discovered at least part of the problem: it looks like
in the current grammar, #line statements are illegal at the beginning of
a compound statement, so if I change the code to this:
static void
runas_setup()
{
if ((sudo_user._runas_pw) ->pw_name != ((void *)0) ) {
{
if (setgid((sudo_user._runas_pw) ->pw_gid))
perror("cannot set gid to runas gid");
# 318 "set_perms.c"
if (! (sudo_defs_table[( 34 )].sd_un.flag) &&
initgroups(* (sudo_user.runas) , (sudo_user._runas_pw) ->pw_gid) < 0)
perror("cannot set group vector");
}
}
}
everything parses. I also tried putting the #line between the "if" line
and the "perror" line, but that will not parse. Also, it looks like
#line must appear after a statement (i.e. not after an
opt_declaration_list). Am I right about this? If so, how can I fix it?
Thanks,
Emil
flisakow wrote:
> Hi,
>
> I received this message from the email list, and I'm CC'ing it back
> to the user's list also, so you should receive two copies. I was
> on vacation for the last week, and didn't reply to any email.
>
> One possible problem is that CTool uses gcc as its preprocessor by
> default (that's controlled by a compile-time option). Perhaps the
> #line directives inserted by that 2nd pass are actually causing
> the problem. There's a remove(cpp_file) call in project.cpp that
> could be commented out so you could see the actual input to CTool
> (its stored in filename.pp).
>
> I'll that a look at this myself in the next few days, but I wanted
> to reply sooner so you'd know the list is not dead.
>
> Shaun
>
>
>>Hi,
>>
>>I'm having trouble parsing a few files in sudo-1.6.5p2 (though I'm
>>having similar problems in other packages). The ctool parser doesn't
>>seem to like files produced by bison/flex (who would? ;). In sudo, the
>>offending files are lex.yy.c and sudo.tab.c. Then there's the file
>>set_perms.c which has a really strange error. I extracted the
>>problematic preprocessed code:
>>
>>static void
>>runas_setup()
>>{
>> if ((sudo_user._runas_pw) ->pw_name != ((void *)0) ) {
>># 314 "set_perms.c"
>> {
>> if (setgid((sudo_user._runas_pw) ->pw_gid))
>> perror("cannot set gid to runas gid");
>>
>>
>>
>>
>> if (! (sudo_defs_table[( 34 )].sd_un.flag) &&
>> initgroups(* (sudo_user.runas) , (sudo_user._runas_pw) ->pw_gid) < 0)
>> perror("cannot set group vector");
>>
>> }
>> }
>>}
>>
>>set_perms.c:312: Error (parse error) before '#line'
>># 313 "set_perms.c"
>> ^
>>set_perms.c:327: Error (parse error) before 'String Constant'
>>}
>>
>>The first error is really strange to me considering that the line
>>mentioned is not in the file! Any ideas on where this is coming from?
>>
>>Thanks,
>>Emil
>>
>>
>>_______________________________________________________________
>>
>>Have big pipes? SourceForge.net is looking for download mirrors. We supply
>>the hardware. You get the recognition. Email Us: ban...@so...
>>_______________________________________________
>>Ctool-users mailing list
>>Cto...@li...
>>https://lists.sourceforge.net/lists/listinfo/ctool-users
>>
>
>
>
|