public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Owens <kaos@ocs.com.au>
To: Paul Gortmaker <p_gortmaker@yahoo.com>
Cc: richbaum@acm.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] More compile warning fixes for 2.4.0
Date: Mon, 08 Jan 2001 00:17:39 +1100	[thread overview]
Message-ID: <310.978873459@ocs3.ocs-net> (raw)
In-Reply-To: Your message of "Sun, 07 Jan 2001 07:41:57 CDT." <3A586415.699EFDE@yahoo.com>

On Sun, 07 Jan 2001 07:41:57 -0500, 
Paul Gortmaker <p_gortmaker@yahoo.com> wrote:
>Rich Baum wrote:
>> 
>> Here's a patch that fixes more of the compile warnings with gcc
>> 2.97.
>> -#endif __SNMP__
>> +#endif /* __SNMP__ */
>
>Might as well automate it for all of these endif ones through the entire
>kernel (assuming you already haven't of course).
>
>Paul.
>  -----------------------------8<-----------8<------------------------
>#!/bin/bash
>for i in `find . -type f -name '*.[chS]'`
>do
>	grep -q '^#endif [A-Za-z0-9_]' $i 2>/dev/null
>	if [ $? == 0 ]; then
>		mv $i $i~
>		sed 's/^#endif \([A-Za-z0-9_]\+$\)/#endif \/\* \1 \*\//'<$i~>$i
>	fi
>done
>  -----------------------------8<-----------8<------------------------

#endif can have white space before '#' and between '#' and 'endif', it
can have tabs instead of spaces, the spurious text is anything that
does not start with '/'.  Time to start a new one liner contest ;) ...

find -type f -name '*.[chS]' | xargs perl -lpi -e 's:^(\s*#\s*endif)\s+([^/\s].*)$:\1\t/* \2 */:;'

It even preserves the existing #endif layout.  That regexp does not
catch #endif /foo, it assumes that '/' always starts a comment.  The
extra complexity to catch that rare case is not worth it.  The command
changed 97 files on base 2.4.0.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2001-01-07 13:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-07  2:40 [PATCH] More compile warning fixes for 2.4.0 Rich Baum
2001-01-07 12:41 ` Paul Gortmaker
2001-01-07 13:17   ` Keith Owens [this message]
2001-01-08 19:50 ` Erik Mouw
2001-01-08 20:17   ` Alan Cox
2001-01-09  5:30   ` Richard Henderson
2001-01-09 10:02     ` Albert D. Cahalan
2001-01-09 15:10       ` Richard B. Johnson
2001-01-09 18:51       ` Linus Torvalds
2001-01-09 21:24         ` Albert D. Cahalan
2001-01-09 21:31           ` Linus Torvalds
2001-01-10  2:20             ` Andrea Arcangeli
2001-01-10  7:10               ` Linus Torvalds
2001-01-10 13:17                 ` Rich Baum
2001-01-10 13:32                 ` Andrea Arcangeli
2001-01-10 16:03                 ` Marco Colombo
2001-01-10 16:52                   ` Alan Shutko
2001-01-10 17:32                     ` Marco Colombo
2001-01-10 17:19                   ` Linus Torvalds
2001-01-10 18:02                     ` Marco Colombo
2001-01-10  1:58         ` Rich Baum
2001-01-09  1:23 ` Rich Baum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=310.978873459@ocs3.ocs-net \
    --to=kaos@ocs.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p_gortmaker@yahoo.com \
    --cc=richbaum@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox