From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: insert-header-preprocessor-definition Date: Wed, 11 Apr 2018 22:41:22 +0200 Organization: Aioe.org NNTP Server Message-ID: <86zi29earx.fsf@zoho.com> References: <86fu429udy.fsf@zoho.com> <87lgdt21a4.fsf@bsb.me.uk> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1523479421 20005 195.159.176.226 (11 Apr 2018 20:43:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 11 Apr 2018 20:43:41 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 11 22:43:37 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f6Mab-0004zz-Nb for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Apr 2018 22:43:33 +0200 Original-Received: from localhost ([::1]:56668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6Mci-00006N-Br for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Apr 2018 16:45:44 -0400 X-Received: by 10.223.182.79 with SMTP id i15mr542309wre.9.1523479282652; Wed, 11 Apr 2018 13:41:22 -0700 (PDT) Original-Path: usenet.stanford.edu!9no253520wml.0!news-out.google.com!a2ni432wmg.0!nntp.google.com!proxad.net!feeder1-2.proxad.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-NNTP-Posting-Host: ey7daRps1n1jd+mMaOEjpw.user.gioia.aioe.org Original-X-Complaints-To: abuse@aioe.org Cancel-Lock: sha1:hZgCZe+oOerY6TY260VGvSd4nXg= Mail-Copies-To: never X-Notice: Filtered by postfilter v. 0.8.3 Original-Xref: usenet.stanford.edu gnu.emacs.help:222354 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:116472 Archived-At: Ben Bacarisse wrote: > this common construction can give rise to C's > dreaded "undefined behaviour". All sorts of > macro names are reserved to the > implementation depending on what headers have > been included in the source file that > includes this one. > > It's common to ignore this rule, but if you > are providing a facility for general use it > might be better to follow letter of the law. > Pre-pending "H_" to the label is known to > be safe. I agree. So for color.c, color.h should have H_COLOR_H? >> (beg-string (concat >> (format "#ifndef %s\n" label) >> (format "#define %s\n\n" label) )) > > I'd probably write > > (concat "#ifndef " label "\n" > "#define " label "\n\n") OK! -- underground experts united http://user.it.uu.se/~embe8573