#1112127 cproto: fails to forward -D arguments to the preprocessor

Package:
cproto
Source:
cproto
Description:
utilities to generate C function prototypes from C source code
Submitter:
наб
Date:
2025-09-02 15:31:03 UTC
Severity:
normal
Tags:
#1112127#5
Date:
2025-08-26 17:21:02 UTC
From:
To:
Dear Maintainer,

  cproto -E '/bin/cpp' -D'ARGS_DECL(...)=__VA_ARGS__' -{P,F,C}"int f(a, b)" exec.c
  /* exec.c */
  sh: 1: Syntax error: "(" unexpected
and a strace reveals
  3076044 execve("/bin/sh", ["sh", "-c", "/bin/cpp -DARGS_DECL(...)=__VA_A"...], 0x7fff30971dc0 /* 32 vars */ <unfinished ...>
this seems obviously wrong, considering that -D is described as
  This option is passed through to the preprocessor
which it isn't in this case, it's inlined into the shell program.

Best,

#1112127#8
Date:
2025-09-01 19:55:55 UTC
From:
To:
actually it's what you get with popen.
The updated manpage says it uses a pipe.

#1112127#13
Date:
2025-09-01 19:55:55 UTC
From:
To:
actually it's what you get with popen.
The updated manpage says it uses a pipe.

#1112127#20
Date:
2025-09-02 09:40:18 UTC
From:
To:
The updated manpage also clarifies the known limitations of cproto's
built-in support for preprocessor directives which prevent its being
used for general-purpose transformation of source code.

This bug can be either closed (wontfix) or changed to a wishlist item.

In either case, it's unlikely that someone's going to write a full-fledged
C preprocessor which can be used in this application.

#1112127#23
Date:
2025-09-02 09:40:18 UTC
From:
To:
The updated manpage also clarifies the known limitations of cproto's
built-in support for preprocessor directives which prevent its being
used for general-purpose transformation of source code.

This bug can be either closed (wontfix) or changed to a wishlist item.

In either case, it's unlikely that someone's going to write a full-fledged
C preprocessor which can be used in this application.

#1112127#28
Date:
2025-09-02 15:28:56 UTC
From:
To:
Version: 4.7y-1
I've reviewed the 4.7y-1 manual, and I think if I had it while doing the
tgif conversion I would not have felt the need to have opened the bugs,
which is equivalent to being fixed. Thus, closing; thanks.
Nor do I think this would be a good use of anyone's time, frankly.

Best,