summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkorbb <korbb@138bc75d-0d04-0410-961f-82ee72b054a4>1999-08-17 18:32:32 +0000
committerkorbb <korbb@138bc75d-0d04-0410-961f-82ee72b054a4>1999-08-17 18:32:32 +0000
commit4a291c1c3a07b211124c7558183a5dcfdd99e1ac (patch)
treed1c9ea2a8f647a76d8a86b4dec5b5a39401c00bc
parente1a10fd82a9b6c1a4c8b28648332d6554d2db389 (diff)
downloadppe42-gcc-4a291c1c3a07b211124c7558183a5dcfdd99e1ac.tar.gz
ppe42-gcc-4a291c1c3a07b211124c7558183a5dcfdd99e1ac.zip
Do not trash single-line C-style comments
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28735 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rwxr-xr-xgcc/fixinc/fixincl.sh2
-rw-r--r--gcc/fixinc/fixincl.x3
-rw-r--r--gcc/fixinc/inclhack.def4
-rwxr-xr-xgcc/fixinc/inclhack.sh3
5 files changed, 13 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0758117e34d..c2b03a255c4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Tue Aug 17 01:40:54 1999 Loren Rittle <ljrittle@acm.org>
+
+ * fixinc/inclhack.def (no_double_slash): Do not trash single-line
+ C-style comments. Do not lose the character before double slash.
+
Mon Aug 16 18:08:22 EDT 1999 Andrew MacLeod <amacleod@cygnus.com>
* basic-block.h (struct edge_list): Stucture to maintain a vector
diff --git a/gcc/fixinc/fixincl.sh b/gcc/fixinc/fixincl.sh
index 9e9064e579e..83d66919f0b 100755
--- a/gcc/fixinc/fixincl.sh
+++ b/gcc/fixinc/fixincl.sh
@@ -6,7 +6,7 @@
# files which are fixed to work correctly with ANSI C and placed in a
# directory that GNU C will search.
#
-# This script contains 105 fixup scripts.
+# This script contains 106 fixup scripts.
#
# See README-fixinc for more information.
#
diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x
index 8fd28805f9d..d17614b9859 100644
--- a/gcc/fixinc/fixincl.x
+++ b/gcc/fixinc/fixincl.x
@@ -709,7 +709,8 @@ tTestDesc aNo_Double_SlashTests[] = {
*/
const char* apzNo_Double_SlashPatch[] = { "sed",
"-e", "s,^//.*$,,",
- "-e", "s,[^:]//[^\"].*$,,",
+ "-e", "s,\\(/\\*.*\\)//\\(.*\\*/\\),\\1/ /\\2,g",
+ "-e", "s,\\([^:]\\)//[^\"].*$,\\1,",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def
index 17da222cbae..fbdc737a855 100644
--- a/gcc/fixinc/inclhack.def
+++ b/gcc/fixinc/inclhack.def
@@ -432,12 +432,14 @@ fix = {
/*
* Test that the file-to-fix does not from a C++ directory
* Also, only accept double slashes that are not part of URL's
+ * and do not appear to be within a single-line C-style comment
* and are not the end of a quoted string.
*/
test = ' -z "`echo ${file} | egrep \'(CC|cxx|\+\+)/\'`"';
select = '(^|[^:])//[^"*]';
sed = 's,^//.*$,,';
- sed = 's,[^:]//[^"].*$,,';
+ sed = 's,\(/\*.*\)//\(.*\*/\),\1/ /\2,g';
+ sed = 's,\([^:]\)//[^"].*$,\1,';
};
diff --git a/gcc/fixinc/inclhack.sh b/gcc/fixinc/inclhack.sh
index 292c9679106..457fc9702c8 100755
--- a/gcc/fixinc/inclhack.sh
+++ b/gcc/fixinc/inclhack.sh
@@ -844,7 +844,8 @@ _EOF_
else infile=${DESTFILE} ; fi
sed -e 's,^//.*$,,' \
- -e 's,[^:]//[^"].*$,,' \
+ -e 's,\(/\*.*\)//\(.*\*/\),\1/ /\2,g' \
+ -e 's,\([^:]\)//[^"].*$,\1,' \
< $infile > ${DESTDIR}/fixinc.tmp
rm -f ${DESTFILE}
mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
OpenPOWER on IntegriCloud