new upstream version [ineffective -q option]

Bug #275248 reported by Nil
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cproto (Ubuntu)
In Progress
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)

Revision history for this message
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/

Revision history for this message
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)
Changed in cproto:
importance: Undecided → Low
Nil (nicolas-limare)
Changed in cproto:
assignee: nobody → nicolas-limare
status: New → Confirmed
Revision history for this message
Nil (nicolas-limare) wrote :

Updated version (4.7-g) on:
ftp://invisible-island.net/cproto

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.