From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: insert-header-preprocessor-definition Date: Sun, 15 Apr 2018 14:44:47 +0700 Message-ID: References: <86fu429udy.fsf@zoho.com> <87lgdt21a4.fsf@bsb.me.uk> <86zi29earx.fsf@zoho.com> <87y3htzclf.fsf@bsb.me.uk> <86po317392.fsf@zoho.com> <871sfhp9hb.fsf@bsb.me.uk> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1523778235 23437 195.159.176.226 (15 Apr 2018 07:43:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 15 Apr 2018 07:43:55 +0000 (UTC) Cc: help-gnu-emacs To: Ben Bacarisse Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Apr 15 09:43:50 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 1f7cKB-0005vg-Pv for geh-help-gnu-emacs@m.gmane.org; Sun, 15 Apr 2018 09:43:47 +0200 Original-Received: from localhost ([::1]:49618 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f7cMG-0000S9-Rv for geh-help-gnu-emacs@m.gmane.org; Sun, 15 Apr 2018 03:45:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f7cLW-0000QX-8I for help-gnu-emacs@gnu.org; Sun, 15 Apr 2018 03:45:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f7cLV-0005Lc-7s for help-gnu-emacs@gnu.org; Sun, 15 Apr 2018 03:45:10 -0400 Original-Received: from mail-oi0-x235.google.com ([2607:f8b0:4003:c06::235]:33148) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f7cLV-0005LP-2G for help-gnu-emacs@gnu.org; Sun, 15 Apr 2018 03:45:09 -0400 Original-Received: by mail-oi0-x235.google.com with SMTP id 126-v6so11863834oig.0 for ; Sun, 15 Apr 2018 00:45:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=+AtD7KvP9Tt/TwiOYodYr7ZLn6bCc3bhvgxDUV17Lhc=; b=qX7t1IvkvV0f+vAPmRvBz6tUbJ0oXBBxJBKSRvQeADEiusGXr0Db6Gccd2CC7LfVCe bJjm2VtpDyLsaSPved/pvxTtVR0DKTwycd74zF5H2PBfiRQyrHSI3RJnpGSFR4SNe/zy 6pbHRUk8rOfS8KhCARHo3Gwa+poQ2Z/QqKRQcYylBsxlqzSZNzfmK2zT9AqO5lidZKxu cwYVp3X1u6Y4DOyfbj4kNnh9mkqy62SO622xT6+4QZQjBC1NZZDWvwrYUzK+l5M4caza j3E3UNILXfKiBGdPv+WlloWGIqQkuMNTtBVIkUNJYJMiYFQeKSfUhHCPqm01BfcOBdS2 LFDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=+AtD7KvP9Tt/TwiOYodYr7ZLn6bCc3bhvgxDUV17Lhc=; b=T+A++RQS5IU2Cm1AUc6zkhroV9rQCvO1KgEawtUR3ly2zx/4Uf/ygoRNObVue6MjCd UuWv94DnbWDfU09+qZdgpwWCTSw+Dr98sMdaTVCWDa6yIJLCvyWLhpQu7SQhli/zIVJq ouEYmlIXahXzMvS6vMNv1gzPaMxY88/9sEZQBbh0urPRZPRX97ie03GHLZqyJtIADFrl k0dueR1pHiebYnJ0c9PK7Z5LLyIWLrJIAZjfW8OuJduRJWvP5Q4/rAI3sg0JAGwR5elc GI9PJiBi4Peg/xw/nvmiTixKO2Ww2z4q51lIFmt13t3KRE2kwVwvUaxfA9jcSRtScHCk K31Q== X-Gm-Message-State: ALQs6tCpqjk+o6Wnwe1DU+2TpdVp9R0x8Sb/dTF4N1GzXc6h8sFRUGMh fTFHc4y5ibjP+zjMBSgFGhXgpLLmt2s5Ld+DnLk= X-Google-Smtp-Source: AIpwx4+Wble0iPhfcXvJJi+fePcKFtYn98N4OZT3mH2w+b+BNQcQFYxZQj9y4QkZzzZKyfM+Rb4ggYuMBCu3XwZW7ZU= X-Received: by 2002:aca:e0c2:: with SMTP id x185-v6mr1685192oig.68.1523778308351; Sun, 15 Apr 2018 00:45:08 -0700 (PDT) Original-Received: by 10.74.186.8 with HTTP; Sun, 15 Apr 2018 00:44:47 -0700 (PDT) In-Reply-To: <871sfhp9hb.fsf@bsb.me.uk> X-Google-Sender-Auth: c3VxCD3VVzxFeafpPCTr7Oh047s X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::235 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:116522 Archived-At: On Sun, Apr 15, 2018 at 8:02 AM, Ben Bacarisse wrote: > The C standard lists, for every header, any patterns of macro names that > are reserved to the implementation. errno.h, for example, reserves all > macro names that start E followed by a digit or another upper case > latter. Thus a program that uses ERROR_H whilst also including errno.h > is technically undefined even if errno.h does not actually use that > macro name. The issue is not limited to standard headers. As long as you start using libraries, you are going to include their headers. Woe unto you if you clash with any macros they define, or with any of their header include guards, past, current or future. The practical solution is, of course, the same as with all name conflict issues: Namespacing. That is, in your project, you start all preprocessor defines with the name of your project. And if the project name is not unique enough, then also with your own name or the name of your company. On the other hand, the two or three compilers out there that are most likely to be used to compile your project already support #pragma once.