From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6A3C3139083 for ; Tue, 5 Dec 2017 18:16:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 98D7BE101D; Tue, 5 Dec 2017 18:16:03 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5C98EE101D for ; Tue, 5 Dec 2017 18:16:03 +0000 (UTC) Received: from Anthonys-MacBook-Pro.local (cpe-67-247-195-186.buffalo.res.rr.com [67.247.195.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: blueness) by smtp.gentoo.org (Postfix) with ESMTPSA id BD1E133BF43; Tue, 5 Dec 2017 18:16:01 +0000 (UTC) Subject: Re: [eudev] [PATCH] use #pragma once for header files To: Marcus Folkesson , eudev@lists.gentoo.org References: <20171204113409.14829-1-marcus.folkesson@gmail.com> From: "Anthony G. Basile" Message-ID: <9219c1ef-0e0f-9d38-90cc-59208cf5410d@gentoo.org> Date: Tue, 5 Dec 2017 13:15:59 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: eudev mailing list X-BeenThere: eudev@gentoo.org X-BeenThere: eudev@lists.gentoo.org MIME-Version: 1.0 In-Reply-To: <20171204113409.14829-1-marcus.folkesson@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Archives-Salt: 4ac8d935-03bf-4f06-a40f-84c60da8300d X-Archives-Hash: 76cc4fe50444218df275f4d8c3dede33 On 12/4/17 6:34 AM, Marcus Folkesson wrote: > Some headerfiles are missing "#pragma once" or corresponding > "#ifndef..." which may result in build error if multiple source files > include the same file. > > Add "#pragma once" for concerned files. > > Signed-off-by: Marcus Folkesson > --- > src/mtd_probe/mtd_probe.h | 2 ++ > src/scsi_id/scsi.h | 2 ++ > src/scsi_id/scsi_id.h | 2 ++ > src/shared/device-nodes.h | 2 ++ > src/shared/fileio.h | 2 ++ > src/shared/path-util.h | 2 ++ > src/shared/siphash24.h | 3 +++ > src/shared/socket-util.h | 2 ++ > src/udev/udevadm-util.h | 2 ++ > 9 files changed, 19 insertions(+) > > diff --git a/src/mtd_probe/mtd_probe.h b/src/mtd_probe/mtd_probe.h > index e048a0122..caea5c269 100644 > --- a/src/mtd_probe/mtd_probe.h > +++ b/src/mtd_probe/mtd_probe.h > @@ -17,6 +17,8 @@ > * Boston, MA 02110-1301 USA > */ > > +#pragma once > + > #include > > #include "macro.h" > diff --git a/src/scsi_id/scsi.h b/src/scsi_id/scsi.h > index c423cac57..3f99ae772 100644 > --- a/src/scsi_id/scsi.h > +++ b/src/scsi_id/scsi.h > @@ -10,6 +10,8 @@ > * Free Software Foundation version 2 of the License. > */ > > +#pragma once > + > #include > > struct scsi_ioctl_command { > diff --git a/src/scsi_id/scsi_id.h b/src/scsi_id/scsi_id.h > index 648b5ce42..141b116a8 100644 > --- a/src/scsi_id/scsi_id.h > +++ b/src/scsi_id/scsi_id.h > @@ -15,6 +15,8 @@ > * along with this program. If not, see . > */ > > +#pragma once > + > #define MAX_PATH_LEN 512 > > /* > diff --git a/src/shared/device-nodes.h b/src/shared/device-nodes.h > index d27ac0906..5df53e8c0 100644 > --- a/src/shared/device-nodes.h > +++ b/src/shared/device-nodes.h > @@ -17,5 +17,7 @@ > along with systemd; If not, see . > ***/ > > +#pragma once > + > int encode_devnode_name(const char *str, char *str_enc, size_t len); > int whitelisted_char_for_devnode(char c, const char *additional); > diff --git a/src/shared/fileio.h b/src/shared/fileio.h > index 641bf0230..7beed2eb8 100644 > --- a/src/shared/fileio.h > +++ b/src/shared/fileio.h > @@ -17,6 +17,8 @@ > along with systemd; If not, see . > ***/ > > +#pragma once > + > #include > #include > > diff --git a/src/shared/path-util.h b/src/shared/path-util.h > index 0123c2609..1d15d4c0f 100644 > --- a/src/shared/path-util.h > +++ b/src/shared/path-util.h > @@ -17,6 +17,8 @@ > along with systemd; If not, see . > ***/ > > +#pragma once > + > #include > > #include "macro.h" > diff --git a/src/shared/siphash24.h b/src/shared/siphash24.h > index 3253c179b..c2c19b437 100644 > --- a/src/shared/siphash24.h > +++ b/src/shared/siphash24.h > @@ -1,3 +1,6 @@ > + > +#pragma once > + > #include > #include > > diff --git a/src/shared/socket-util.h b/src/shared/socket-util.h > index 2daa3279f..52b8dff66 100644 > --- a/src/shared/socket-util.h > +++ b/src/shared/socket-util.h > @@ -17,6 +17,8 @@ > along with systemd; If not, see . > ***/ > > +#pragma once > + > #include > #include > #include > diff --git a/src/udev/udevadm-util.h b/src/udev/udevadm-util.h > index dba651fdd..37e4fe836 100644 > --- a/src/udev/udevadm-util.h > +++ b/src/udev/udevadm-util.h > @@ -15,6 +15,8 @@ > * along with this program. If not, see . > */ > > +#pragma once > + > #include "udev.h" > > struct udev_device *find_device(struct udev *udev, > I know we have some clang users. Does #pragma work for clang? -- Anthony G. Basile, Ph.D. Gentoo Linux Developer [Hardened] E-Mail : blueness@gentoo.org GnuPG FP : 1FED FAD9 D82C 52A5 3BAB DC79 9384 FA6E F52D 4BBA GnuPG ID : F52D4BBA