File: 0003-fix-false-positives-cpp-style-comments.patch

package info (click to toggle)
autoconf 2.72-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,804 kB
  • sloc: sh: 5,553; perl: 3,933; makefile: 123; lisp: 104
file content (21 lines) | stat: -rw-r--r-- 849 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Description: Fix autoscan false positives in C++ comments
 autoscan currently misidentifies tokens inside C++-style // comments
 because it only strips classic C /* */ comments. This patch ensures
 that // comments are stripped after strings are processed, preventing
 false positives in configure.ac generation.
Author: Arian Ott <arian.ott@ieee.org>
Bug-Debian: https://bugs.debian.org/826934
Forwarded: no
Last-Update: 2026-03-02
Index: autoconf/bin/autoscan.in
===================================================================
--- autoconf.orig/bin/autoscan.in
+++ autoconf/bin/autoscan.in
@@ -291,6 +291,7 @@ sub scan_c_file ($)
       # Remove string and character constants.
       s,\"[^\"]*\",,g;
       s,\'[^\']*\',,g;
+      s,//.*$,,;
 
       # Tokens in the code.
       # Maybe we should ignore function definitions (in column 0)?