new upstream version [ineffective -q option]

Bug #275248 reported by Nil on 2008-09-27
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cproto (Ubuntu)

Bug Description

The "-q" option of cproto ("Do not output any error messages when the
program cannot read the file specified in an #include directive.")
is not effective.


 $ cat foo.c
 #include "foo.h"
 #include "bar.h"

 int foo(int x, int y)
      return 0;

 $ cproto -q foo.c
 /* foo.c */
 foo.c:1:17: error: foo.h: No such file or directory
 foo.c:2:17: error: bar.h: No such file or directory
 int foo(int x, int y);

"-q" option sets the `quiet` variable to TRUE (cproto.c), and `quiet`
is only used in lex_yy.c, lines 3030+.

    if (!quiet) {
        fprintf(stderr, "cannot read file %s\n", file_spec);

Examining the source and a strace log, it seems to come through libc:

 access("/etc/", F_OK) = -1 ENOENT (No such file or directory)

Nil (nicolas-limare) wrote :

For the previous message I checked the 4.6 cproto source[1].
In fact the package is built from cproto 4.7e[2].

My remarks are still valid, the only difference is that the last code
fragment refers now to lex.l:1021+ instead of lex_yy.c:3030+.


Nil (nicolas-limare) wrote :

answer from the upstream author:

> thanks. That's coming from the C preprocessor (there might be a way
> to improve this by modifying the popen to redirect the standard
> error - will see).
> The -q option was probably documented to cover this case:
> cproto -q -E0 foo.c
> which does the expected thing.

William Grant (wgrant) on 2008-09-29
Changed in cproto:
importance: Undecided → Low
Nil (nicolas-limare) on 2008-09-29
Changed in cproto:
assignee: nobody → nicolas-limare
status: New → Confirmed
Nil (nicolas-limare) wrote :

Updated version (4.7-g) on:

Nil (nicolas-limare) wrote :

Updated version (4.7-g) is in Jaunty.

Changed in cproto:
status: Confirmed → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers