Re: FYI: 1500+ typos, with suggested fixes

2012-05-29 Thread Arnaud Charlet
 Also note: the line numbers listed below work for me with yesterday's
 up-to-date trunk, but if you want to use these commands, you should rerun
 the commands above so that the line numbers reflect your actual sources.
 )
 
 This is just a heads up.
 I'm not volunteering to make these changes.

FWIW, there are many false positives on the gcc/ada directory (missing
Ada specific notions and acronyms). A few real typo fixes also of course,
but the ratio does not look very good.

Arno


Re: FYI: 1500+ typos, with suggested fixes

2012-05-29 Thread Tristan Gingold

On May 29, 2012, at 2:49 PM, Jim Meyering wrote:

 Running the following command spots over 1500 typos, and suggests fixes:
 
  $ git ls-files|misspellings -f -|grep -v '^ERROR:'|perl -pe \
  's/^(.*?)\[(\d+)\]: (\w+) - (.*?)$/sed -i '\''${2}s!$3!$4!'\'' $1/'  k
 
 The misspellings command comes from here:
  http://github.com/lyda/misspell-check
 
 From the list below, I've excluded any that affect ChangeLog or .po files:
 
  $ grep -vE 'ChangeLog|\.po$' k  k2
 
 (Note that these sed commands are just suggestions that do not take
 into account any context, and that some of them have two or more
 alternates, so that applying the sed command as-is would be invalid.
 
 Also note: the line numbers listed below work for me with yesterday's
 up-to-date trunk, but if you want to use these commands, you should rerun
 the commands above so that the line numbers reflect your actual sources.
 )
 
 This is just a heads up.
 I'm not volunteering to make these changes.

Some of them are wrong for Ada:

 sed -i '80s!withing!within!' gcc/ada/a-calend-vms.adb
 sed -i '79s!withing!within!' gcc/ada/a-calend.adb
 sed -i '1488s!withing!within!' gcc/ada/a-calend.adb

withing is the action of 'with' a unit.

 sed -i '41s!STPO!Stop!' gcc/ada/a-dynpri.adb

STPO is the acronym of System.Task_Primitives.Operations


Tristan.



Re: FYI: 1500+ typos, with suggested fixes

2012-05-29 Thread Jim Meyering
Arnaud Charlet wrote:

 Also note: the line numbers listed below work for me with yesterday's
 up-to-date trunk, but if you want to use these commands, you should rerun
 the commands above so that the line numbers reflect your actual sources.
 )

 This is just a heads up.
 I'm not volunteering to make these changes.

 FWIW, there are many false positives on the gcc/ada directory (missing
 Ada specific notions and acronyms). A few real typo fixes also of course,
 but the ratio does not look very good.

In any list of that size, at least a few are guaranteed to be false positives.
That's why I wrote this part:

   (Note that these sed commands are just suggestions that do not take
   into account any context ...

The figure of 1500+ was rounded down from the actual total of 1586 suggestions.
Eliminating the FPs matching /TJE|TEH|STPO|withing/i reduces that to 1501.


Re: FYI: 1500+ typos, with suggested fixes

2012-05-29 Thread Joseph S. Myers
A lot of the changes are to files that GCC either imports strictly 
verbatim with no local changes at all, or will make changes locally to 
only for serious issues relating to integration with GCC; in either case, 
such typos cannot justify making changes locally in GCC so if you want 
those issues fixed you'll need to send them to the relevant upstream 
projects.

On Tue, 29 May 2012, Jim Meyering wrote:

 sed -i '711s!Cant!Cannot,Can not,Can't!' boehm-gc/allchblk.c

boehm-gc is externally maintained so such changes would need to go 
upstream.

 sed -i '130s!RELA!Real!' gcc/config/stormy16/stormy-abi

In general this looks spurious in anything dealing with ELF.

 sed -i '26s!ASLO!Also!' gcc/testsuite/ada/acats/tests/a/ae3002g.ada

ACATS is an external project so changes would need to go upstream.

 sed -i '1s!throught!thought,through,throughout!' 
 gcc/testsuite/c-c++-common/pr41779.c

I don't think it's particularly worthwhile fixing typos in testcases.

 sed -i '323s!loosing!losing!' intl/dcigettext.c
 sed -i '720s!thru!through!' intl/plural.c

libintl comes from gettext so changes would need to go upstream.

 sed -i '87s!relevent!relevant!' libffi/src/arm/gentramp.sh

libffi is externally maintained so it's best for changes to go upstream.

 sed -i '37s!truely!truly!' libgcc/soft-fp/op-common.h

soft-fp is part of glibc so changes should go upstream.

 sed -i '25s!sence!since,sense!' libgo/go/compress/flate/deflate.go

libgo is maintained elsehwere so changes should go upstream.

 sed -i '576s!sould!could,soul,should,sold!' libjava/classpath/NEWS

classpath is an external project so changes should go upstream.

 sed -i '5133s!Ammend!Amend!' libstdc++-v3/doc/html/ext/lwg-active.html

These files are maintained by WG21 so changes should go there.

 sed -i '34s!untill!until!' zlib/contrib/ada/zlib-streams.ads

zlib is an external project so changes should go upstream.

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: FYI: 1500+ typos, with suggested fixes

2012-05-29 Thread Joseph S. Myers
On Tue, 29 May 2012, Jim Meyering wrote:

 sed -i '464s!occurence!occurrence!' gcc/doc/include/texinfo.tex
 sed -i '4802s!achive!archive,achieve!' gcc/doc/include/texinfo.tex

I missed these when first listing files from upstream projects; anyway, 
I've now updated texinfo.tex from upstream to fix these.

2012-05-29  Joseph Myers  jos...@codesourcery.com

* doc/include/texinfo.tex: Update to version 2012-05-16.16.

Tested with make pdf.  Diffs omitted.

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: FYI: 1500+ typos, with suggested fixes

2012-05-29 Thread Jim Meyering
Joseph S. Myers wrote:
 I've applied this patch to fix what seemed to be some of the more
 straightforward cases covered by gcc/ChangeLog.

Thanks.  I've run the same thing on gettext and reported the results upstream.


Re: FYI: 1500+ typos, with suggested fixes

2012-05-29 Thread Joseph S. Myers
On Tue, 29 May 2012, Jim Meyering wrote:

 sed -i '167s!Millenial!Millennial!' libgcc/config/libbid/bid128_string.c
 sed -i '30s!guranteed!guaranteed!' libgcc/config/libbid/bid64_fma.c
 sed -i '174s!oposite!opposite!' libgcc/config/libbid/bid64_fma.c
 sed -i '218s!oposite!opposite!' libgcc/config/libbid/bid64_fma.c
 sed -i '154s!Millenial!Millennial!' libgcc/config/libbid/bid64_string.c
 sed -i '1825s!pased!passed!' libgcc/config/libbid/bid_internal.h

libbid is also externally maintained, see 
http://gcc.gnu.org/codingconventions.html.

I've applied this patch with fixes for some of the more straightforward 
issues in the rest of libgcc and in libcpp.

I suggest sending an updated typo list for current sources - minus the 
parts for directories identified as maintained elsewhere, and possibly 
split by directory - as smaller lists are easier for people to go through.  
For libjava and gcc/java changes, CC j...@gcc.gnu.org on the list (they 
may well be able to deal with the classpath typos although properly it's a 
separate project).  For libstdc++-v3 changes (other than 
libstdc++-v3/doc/html/ext/ which are files from WG21), CC 
libstd...@gcc.gnu.org.

Index: libgcc/configure.ac
===
--- libgcc/configure.ac (revision 187963)
+++ libgcc/configure.ac (working copy)
@@ -315,7 +315,7 @@
 AC_SUBST(vis_hide)
 
 # See if we have thread-local storage.  We can only test assembler
-# sicne link-time and run-time tests require the newly built
+# since link-time and run-time tests require the newly built
 # gcc, which can't be used to build executable due to that libgcc
 # is yet to be built here.
 GCC_CHECK_CC_TLS
Index: libgcc/ChangeLog
===
--- libgcc/ChangeLog(revision 187963)
+++ libgcc/ChangeLog(working copy)
@@ -1,3 +1,33 @@
+2012-05-29  Joseph Myers  jos...@codesourcery.com
+
+   * config/arm/ieee754-df.S: Fix typos.
+   * config/arm/ieee754-sf.S: Fix typos.
+   * config/c6x/libunwind.S: Fix typos.
+   * config/epiphany/udivsi3-float.c: Fix typos.
+   * config/microblaze/muldi3_hard.S: Fix typos.
+   * config/picochip/adddi3.S: Fix typos.
+   * config/picochip/ashlsi3.S: Fix typos.
+   * config/picochip/ashrsi3.S: Fix typos.
+   * config/picochip/clzsi2.S: Fix typos.
+   * config/picochip/cmpsi2.S: Fix typos.
+   * config/picochip/divmod15.S: Fix typos.
+   * config/picochip/divmodhi4.S: Fix typos.
+   * config/picochip/divmodsi4.S: Fix typos.
+   * config/picochip/longjmp.S: Fix typos.
+   * config/picochip/lshrsi3.S: Fix typos.
+   * config/picochip/parityhi2.S: Fix typos.
+   * config/picochip/popcounthi2.S: Fix typos.
+   * config/picochip/setjmp.S: Fix typos.
+   * config/picochip/subdi3.S: Fix typos.
+   * config/picochip/ucmpsi2.S: Fix typos.
+   * config/picochip/udivmodhi4.S: Fix typos.
+   * config/picochip/udivmodsi4.S: Fix typos.
+   * config/spu/divv2df3.c: Fix typos.
+   * config/spu/mfc_multi_tag_release.c: Fix typos.
+   * config/spu/mfc_tag_release.c: Fix typos.
+   * configure.ac: Fix typos.
+   * configure: Regenerate.
+
 2012-05-25  Ian Lance Taylor  i...@google.com
 
* config/i386/morestack.S (__morestack_non_split): Check whether
Index: libgcc/config/c6x/libunwind.S
===
--- libgcc/config/c6x/libunwind.S   (revision 187963)
+++ libgcc/config/c6x/libunwind.S   (working copy)
@@ -113,7 +113,7 @@
# Zero demand saved flags
mvk .s1 0, A0
stw .d2t1   A0, *+B15[1]
-   # Save return address, setup additional argument and call fucntion
+   # Save return address, setup additional argument and call function
stw .d2t2   B3, *+B15[35]
add .d\argside  B15, 4, \argreg
do_call __gnu\name
Index: libgcc/config/spu/mfc_tag_release.c
===
--- libgcc/config/spu/mfc_tag_release.c (revision 187963)
+++ libgcc/config/spu/mfc_tag_release.c (working copy)
@@ -25,7 +25,7 @@
 extern vector unsigned int __mfc_tag_table;
 
 /* Release the specified DMA tag from exclusive use.  Once released, the
-   tag is available for future reservation.  Upon sucessful release,
+   tag is available for future reservation.  Upon successful release,
MFC_DMA_TAG_VALID is returned.  If the specified tag is not in the
range 0 to 31, or had not been reserved, no action is taken and
MFC_DMA_TAG_INVALID is returned.  */
Index: libgcc/config/spu/mfc_multi_tag_release.c
===
--- libgcc/config/spu/mfc_multi_tag_release.c   (revision 187963)
+++ libgcc/config/spu/mfc_multi_tag_release.c   (working copy)
@@ -26,7 +26,7 @@
 
 /* Release a sequential group of tags from exclusive use. The sequential
group of 

Re: FYI: 1500+ typos, with suggested fixes

2012-05-29 Thread Joseph S. Myers
On Tue, 29 May 2012, Joseph S. Myers wrote:

 For libjava and gcc/java changes, CC j...@gcc.gnu.org on the list (they 
 may well be able to deal with the classpath typos although properly it's a 
 separate project).  For libstdc++-v3 changes (other than 
 libstdc++-v3/doc/html/ext/ which are files from WG21), CC 
 libstd...@gcc.gnu.org.

Also, for changes to gcc/fortran/ and libgfortran/, CC 
fort...@gcc.gnu.org.

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: FYI: 1500+ typos, with suggested fixes

2012-05-29 Thread Joseph S. Myers
On Tue, 29 May 2012, Jim Meyering wrote:

 sed -i '8s!compability!compatibility!' config/mt-sde
 sed -i '21s!enviroments!environments!' config/stdint.m4
 sed -i '293s!arbitary!arbitrary!' config/tcl.m4
 sed -i '376s!arbitary!arbitrary!' config/tcl.m4
 sed -i '818s!apropriate!appropriate!' config/tcl.m4

I've applied this patch to config/ and resynced config/ in the src 
repository from the GCC copy (there didn't appear to be any src-local 
changes not applied to GCC).

Index: mt-sde
===
--- mt-sde  (revision 187967)
+++ mt-sde  (working copy)
@@ -5,6 +5,6 @@
 # as they have the D-to-I redirect for PC-relative loads.  -mno-gpopt
 # has two purposes: it allows libraries to be used in situations where
 # $gp != our _gp, and it allows them to be built with -G8 while
-# retaining link compability with -G0 and -G4.
+# retaining link compatibility with -G0 and -G4.
 CFLAGS_FOR_TARGET += -Os -minterlink-mips16 -mcode-xonly -mno-gpopt
 CXXFLAGS_FOR_TARGET += -Os -minterlink-mips16 -mcode-xonly -mno-gpopt
Index: stdint.m4
===
--- stdint.m4   (revision 187967)
+++ stdint.m4   (working copy)
@@ -18,7 +18,7 @@
 dnl existence of an include file stdint.h that defines a set of
 dnl typedefs, especially uint8_t,int32_t,uintptr_t.
 dnl Many older installations will not provide this file, but some will
-dnl have the very same definitions in inttypes.h. In other enviroments
+dnl have the very same definitions in inttypes.h. In other environments
 dnl we can use the inet-types in sys/types.h which would define the
 dnl typedefs int8_t and u_int8_t respectivly.
 dnl
Index: ChangeLog
===
--- ChangeLog   (revision 187967)
+++ ChangeLog   (working copy)
@@ -1,3 +1,9 @@
+2012-05-29  Joseph Myers  jos...@codesourcery.com
+
+   * mt-sde: Fix typos.
+   * stdint.m4: Fix typos.
+   * tcl.m4: Fix typos.
+
 2012-04-03  Tristan Gingold  ging...@adacore.com
 
* mmap.m4: Use *vms* instead of vms*.
Index: tcl.m4
===
--- tcl.m4  (revision 187967)
+++ tcl.m4  (working copy)
@@ -290,7 +290,7 @@
 elif test `uname -s` = Darwin; then
# If Tcl was built as a framework, attempt to use the libraries
# from the framework at the given location so that linking works
-   # against Tcl.framework installed in an arbitary location.
+   # against Tcl.framework installed in an arbitrary location.
case ${TCL_DEFS} in
*TCL_FRAMEWORK*)
if test -f ${TCL_BIN_DIR}/${TCL_LIB_FILE}; then
@@ -373,7 +373,7 @@
 elif test `uname -s` = Darwin; then
# If Tk was built as a framework, attempt to use the libraries
# from the framework at the given location so that linking works
-   # against Tk.framework installed in an arbitary location.
+   # against Tk.framework installed in an arbitrary location.
case ${TK_DEFS} in
*TK_FRAMEWORK*)
if test -f ${TK_BIN_DIR}/${TK_LIB_FILE}; then
@@ -815,7 +815,7 @@
 #
 #  Defines the following variable:
 #
-#  MAN_FLAGS - The apropriate flags for installManPage
+#  MAN_FLAGS - The appropriate flags for installManPage
 #  according to the user's selection.
 #
 #

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: FYI: 1500+ typos, with suggested fixes

2012-05-29 Thread Joseph S. Myers
On Tue, 29 May 2012, Jim Meyering wrote:

 Running the following command spots over 1500 typos, and suggests fixes:
 
   $ git ls-files|misspellings -f -|grep -v '^ERROR:'|perl -pe \
   's/^(.*?)\[(\d+)\]: (\w+) - (.*?)$/sed -i '\''${2}s!$3!$4!'\'' $1/'  k

This command has some bugs in how it produces fixes, fixing them would 
make the output more useful in some cases:

 sed -i '1811s!MISCELANEOUS!Miscellaneous!' gcc/config/mn10300/mn10300.md

Should preserve the case of all-uppercase words.

 sed -i '2102s!hasnt!hasn't!' gcc/config/picochip/picochip.c

Needs to allow for the ' in the replacement string.

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: FYI: 1500+ typos, with suggested fixes

2012-05-29 Thread Joseph S. Myers
I've applied these fixes for three miscellaneous directories with a single 
typo each to fix (gcc/c-family, libmudflap, lto-plugin).

Index: libmudflap/mf-impl.h
===
--- libmudflap/mf-impl.h(revision 187979)
+++ libmudflap/mf-impl.h(working copy)
@@ -46,7 +46,7 @@
 
 /* Private definitions related to mf-runtime.h  */
 
-#define __MF_TYPE_MAX_CEM  __MF_TYPE_STACK  /* largest type# for the cemetary 
*/
+#define __MF_TYPE_MAX_CEM  __MF_TYPE_STACK  /* largest type# for the cemetery 
*/
 #define __MF_TYPE_MAX __MF_TYPE_GUESS
 
 
Index: libmudflap/ChangeLog
===
--- libmudflap/ChangeLog(revision 187979)
+++ libmudflap/ChangeLog(working copy)
@@ -1,3 +1,7 @@
+2012-05-29  Joseph Myers  jos...@codesourcery.com
+
+   * mf-impl.h: Fix typo.
+
 2012-05-16  H.J. Lu  hongjiu...@intel.com
 
* configure: Regenerated.
Index: lto-plugin/ChangeLog
===
--- lto-plugin/ChangeLog(revision 187979)
+++ lto-plugin/ChangeLog(working copy)
@@ -1,3 +1,7 @@
+2012-05-29  Joseph Myers  jos...@codesourcery.com
+
+   * lto-plugin.c: Fix typo.
+
 2012-05-16  H.J. Lu  hongjiu...@intel.com
 
* configure: Regenerated.
Index: lto-plugin/lto-plugin.c
===
--- lto-plugin/lto-plugin.c (revision 187979)
+++ lto-plugin/lto-plugin.c (working copy)
@@ -754,7 +754,7 @@
   conflicts-syms = xmalloc (sizeof (struct ld_plugin_symbol) * outlen);
   conflicts-aux = xmalloc (sizeof (struct sym_aux) * outlen);
 
-  /* Move all duplicate symbols into the auxillary conflicts table. */
+  /* Move all duplicate symbols into the auxiliary conflicts table. */
   out = 0;
   for (i = 0; i  t-nsyms; i++) 
 {
Index: gcc/c-family/ChangeLog
===
--- gcc/c-family/ChangeLog  (revision 187979)
+++ gcc/c-family/ChangeLog  (working copy)
@@ -1,3 +1,7 @@
+2012-05-29  Joseph Myers  jos...@codesourcery.com
+
+   * c-common.c: Fix typo.
+
 2012-05-29  Michael Matz  m...@suse.de
 
* c-common.h (c_expand_decl): Remove prototype.
Index: gcc/c-family/c-common.c
===
--- gcc/c-family/c-common.c (revision 187979)
+++ gcc/c-family/c-common.c (working copy)
@@ -3960,7 +3960,7 @@
 
   /* Replace the integer argument with a suitable product by the object size.
  Do this multiplication as signed, then convert to the appropriate type
- for the pointer operation and disregard an overflow that occured only
+ for the pointer operation and disregard an overflow that occurred only
  because of the sign-extension change in the latter conversion.  */
   {
 tree t = build_binary_op (loc,

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: FYI: 1500+ typos, with suggested fixes

2012-05-29 Thread Jim Meyering
Joseph S. Myers wrote:

 On Tue, 29 May 2012, Jim Meyering wrote:

 Running the following command spots over 1500 typos, and suggests fixes:

   $ git ls-files|misspellings -f -|grep -v '^ERROR:'|perl -pe \
   's/^(.*?)\[(\d+)\]: (\w+) - (.*?)$/sed -i '\''${2}s!$3!$4!'\'' $1/'  k

 This command has some bugs in how it produces fixes, fixing them would
 make the output more useful in some cases:

 sed -i '1811s!MISCELANEOUS!Miscellaneous!' gcc/config/mn10300/mn10300.md

 Should preserve the case of all-uppercase words.

I suppose that would be useful.

 sed -i '2102s!hasnt!hasn't!' gcc/config/picochip/picochip.c

 Needs to allow for the ' in the replacement string.

I can do that on the command line, but it may not be worth it.
It's getting pretty ugly:

git ls-files|misspellings -f -|grep -v '^ERROR:'|perl -p \
  -e '/^(.*?)\[(\d+)\]: (\w+) - (.*?)$/ or next;' \
  -e '($file,$N,$L,$R)=($1,$2,$3,$4); $q='\''; $R=~s/$q/$q\\$q$q/g;' \
  -e 's/.*/sed -i $q${N}s!$L!$R!$q $file/'

I.e., it would print this:

sed -i '2102s!hasnt!hasn'\''t!' gcc/config/picochip/picochip.c


Re: FYI: 1500+ typos, with suggested fixes

2012-05-29 Thread Mike Stump
On May 29, 2012, at 5:49 AM, Jim Meyering wrote:
 Running the following command spots over 1500 typos, and suggests fixes:
 
  $ git ls-files|misspellings -f -|grep -v '^ERROR:'|perl -pe \
  's/^(.*?)\[(\d+)\]: (\w+) - (.*?)$/sed -i '\''${2}s!$3!$4!'\'' $1/'  k

Hum, maybe a make rule (only run by hand), with a file that lists a gcc 
whitelist of things we like, withing, such a nice word...