Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
73e2ea18
Commit
73e2ea18
authored
May 07, 1992
by
Roland McGrath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
entered into RCS
From-SVN: r927
parent
c2724863
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
109 additions
and
0 deletions
+109
-0
gcc/fixcpp
+109
-0
No files found.
gcc/fixcpp
0 → 100755
View file @
73e2ea18
#!/bin/sh
#
# NAME:
# fixcpp - fix CPP errors
#
# SYNOPSIS:
# fixcpp [-c][-p patch_file][-b bak_dir][-n new_dir] files(s)
#
# DESCRIPTION:
# For each named file, use sed(1) to fixup any descriptive
# text after #else or #endif or that is not properly
# commented as this causes ANSI compilers to generate
# unnecessary warnings.
#
# Naturally this script is not guaranteed to be bullet
# proof, use of -n or -b is advisable!
#
# -c causes fixcpp to make sure that only files that
# needed changing are affected by returning the original
# file to its original location if no changes were needed.
#
# -p causes fixcpp to append to a patch file the context
# diffs of the changes wrought.
#
# SEE ALSO:
# sed(1)
#
# AMENDED:
# 90/08/08 22:46:32 (sjg)
#
# RELEASED:
# 90/08/08 22:46:34 v1.4
#
# SCCSID:
# @(#)fixcpp.sh 1.4 90/08/08 22:46:32 (sjg)
#
# @(#)Copyright (c) 1990 Simon J. Gerraty
#
# This is free software. It comes with NO WARRANTY.
# Everyone is granted permission to copy, modify and
# redistribute this source code provided that all
# recipients are given similar rights, and that the above
# copyright notice and this notice are preserved in all
# copies.
TMPF
=
/tmp/fixcpp.
$$
NEWDIR
=
BAKDIR
=
PATCHF
=
CHECK
=
set
--
`
getopt
"cp:b:n:"
$*
`
if
[
$?
!=
0
]
;
then
echo
"
$0
[-c][-p patch_file][-b bakup_dir][-n new_dir] file [file ...]"
>
&2
exit
1
fi
for
i
in
$*
do
case
$i
in
-c
)
CHECK
=
yes
;
shift
;;
-p
)
PATCHF
=
$2
;
shift
2
;;
-b
)
BAKDIR
=
$2
;
shift
2
;;
-n
)
NEWDIR
=
$2
;
shift
2
;;
--
)
shift
;
break
;;
esac
done
NEWDIR
=
${
NEWDIR
:-
.
}
if
[
$BAKDIR
]
;
then
if
[
!
-d
$BAKDIR
]
;
then
echo
"
$0
: no such directory --
$BAKDIR
"
>
&2
exit
1
fi
fi
for
i
in
$*
do
if
[
$BAKDIR
]
;
then
mv
$i
$BAKDIR
infile
=
$BAKDIR
/
$i
else
if
[
"
$NEWDIR
"
=
"."
]
;
then
mv
$i
${
TMPF
}
infile
=
${
TMPF
}
else
infile
=
$i
fi
fi
sed
-e
's;^#\([ ]*e[nl][^ ]*[ ][ ]*\)\([^/ ][^\*].*\);#\1/* \2 */;'
-e
's;^#\([ ]*e[nl][^ ]*[ ][ ]*\)\([^/ ]\)$;#\1/* \2 */;'
$infile
>
${
NEWDIR
}
/
$i
if
[
"
${
CHECK
}
"
=
"yes"
-o
${
PATCHF
}
]
;
then
if
cmp
-s
$infile
${
NEWDIR
}
/
$i
;
then
if
[
"
${
CHECK
}
"
=
"yes"
]
;
then
if
[
$BAKDIR
]
;
then
mv
$infile
${
NEWDIR
}
/
$i
else
rm
${
NEWDIR
}
/
$i
fi
fi
else
if
[
$PATCHF
]
;
then
diff
-c
$infile
${
NEWDIR
}
/
$i
>>
${
PATCHF
}
fi
fi
fi
done
rm
-f
${
TMPF
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment