Ubuntu

new upstream version [ineffective -q option]

Reported by Nil on 2008-09-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cproto (Ubuntu)
Low
Nil

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.

Example:

 $ 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) {
        put_error();
        fprintf(stderr, "cannot read file %s\n", file_spec);
    }

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

 access("/etc/ld.so.nohwcap", 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+.

[1]http://sourceforge.net/projects/cproto/
[2]ftp://dickey.his.com/cproto/

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:
ftp://invisible-island.net/cproto

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