All of lore.kernel.org
 help / color / mirror / Atom feed
* [Powertop] Addition of two include guards?
@ 2014-11-01 18:04 SF Markus Elfring
  0 siblings, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2014-11-01 18:04 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

Hello,

I suggest to add include guards to two header files so that their reuse might
become a bit safer.
https://www.securecoding.cert.org/confluence/display/cplusplus/PRE06-CPP.+Enclose+header+files+in+an+inclusion+guard

Regards,
Markus

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Addition-of-two-include-guards.patch --]
[-- Type: text/x-patch, Size: 1561 bytes --]

>From fd7d3c5927aac8c474ac44f5b0e00f5768a8cb24 Mon Sep 17 00:00:00 2001
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 1 Nov 2014 18:58:38 +0100
Subject: [PATCH] Addition of two include guards

Unique include guards were added to two header files to make their reuse
a bit safer.
https://www.securecoding.cert.org/confluence/display/cplusplus/PRE06-CPP.+Enclose+header+files+in+an+inclusion+guard

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 src/cpu/intel_cpus.h          | 4 ++++
 src/report/report-data-html.h | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/src/cpu/intel_cpus.h b/src/cpu/intel_cpus.h
index cde4a2d..810a243 100644
--- a/src/cpu/intel_cpus.h
+++ b/src/cpu/intel_cpus.h
@@ -1,3 +1,5 @@
+#ifndef PowerTop_INTEL_CPUS_H_84F09FB4F519470FA914AA9B02453221
+#define PowerTop_INTEL_CPUS_H_84F09FB4F519470FA914AA9B02453221
 /*
  * Copyright 2010, Intel Corporation
  *
@@ -171,3 +173,5 @@ public:
 
 int is_supported_intel_cpu(int model);
 int byt_has_ahci();
+
+#endif
diff --git a/src/report/report-data-html.h b/src/report/report-data-html.h
index 616b294..fa796e9 100644
--- a/src/report/report-data-html.h
+++ b/src/report/report-data-html.h
@@ -1,3 +1,6 @@
+#ifndef PowerTop_REPORT_DATA_HTML_H_C58C116411234A34AC2EFB8D23A69713
+#define PowerTop_REPORT_DATA_HTML_H_C58C116411234A34AC2EFB8D23A69713
+
 #include <string>
 #include <sstream>
 
@@ -67,3 +70,4 @@ init_tune_table_attr(struct table_attributes *table_css, int rows, int cols);
 string
 double_to_string(double dval);
 
+#endif
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* Re: [Powertop] Addition of two include guards?
@ 2014-11-02 19:17 Alexandra Yates
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandra Yates @ 2014-11-02 19:17 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 479 bytes --]


> Hello,
>
> I suggest to add include guards to two header files so that their reuse
> might
> become a bit safer.
> https://www.securecoding.cert.org/confluence/display/cplusplus/PRE06-CPP.+Enclose+header+files+in+an+inclusion+guard
>
> Regards,
> Markus
> _______________________________________________
> PowerTop mailing list
> PowerTop(a)lists.01.org
> https://lists.01.org/mailman/listinfo/powertop
>

the link is not available.

Thank you,
Alexandra.

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: [Powertop] Addition of two include guards?
@ 2014-11-14  4:42 Alexandra Yates
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandra Yates @ 2014-11-14  4:42 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 467 bytes --]


> Hello,
>
> I suggest to add include guards to two header files so that their reuse
> might
> become a bit safer.
> https://www.securecoding.cert.org/confluence/display/cplusplus/PRE06-CPP.+Enclose+header+files+in+an+inclusion+guard
>
> Regards,
> Markus
> _______________________________________________
> PowerTop mailing list
> PowerTop(a)lists.01.org
> https://lists.01.org/mailman/listinfo/powertop
>
Patch was added.

Thank you,
Alexandra.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-14  4:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-01 18:04 [Powertop] Addition of two include guards? SF Markus Elfring
  -- strict thread matches above, loose matches on Subject: below --
2014-11-02 19:17 Alexandra Yates
2014-11-14  4:42 Alexandra Yates

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.