Skip to contentSkip to conversation

Addition of two include guards?

Powertop SF Markus Elfring 3 participants 7 messages Nov 1, 2014 – Nov 14, 2014

lore
Share & tools
lore

SF Markus Elfring

author
#0 lore raw

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

Quoted 1 line

From fd7d3c5927aac8c474ac44f5b0e00f5768a8cb24 Mon Sep 17 00:00:00 2001

From: Markus Elfring <[email protected]>
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

---
 src/cpu/intel_cpus.h          | 4 ++++
 src/report/report-data-html.h | 4 ++++
 2 files changed, 8 insertions(+)
src/cpu/intel_cpus.h +4 -0
index cde4a2d..810a243 100644
@@ -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
src/report/report-data-html.h +4 -0
index 616b294..fa796e9 100644
@@ -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
Signature · 1 line
2.1.3
#3 lore raw

Re: [Powertop] Testing CERT links

Quoted 15 lines
Quoted 2 lines
Quoted 2 lines

https://www.securecoding.cert.org/confluence/display/cplusplus/PRE06-CPP.+Enclose+header+files+in+an+inclusion+guard

[...]

Quoted 1 line

the link is not available.

The example above worked for me again a moment ago. Would you like to try a shorter link out?
https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=637

Regards,
Markus

Still not available. See attached.

Thank you,
Alexandra.

author
#4 lore raw

Re: [Powertop] Testing CERT links

Quoted 1 line

Still not available.

Will the address "https://www.cert.org/" work for you?

Can a command like traceroute give you any insights for your internet access status on these target examples?

Regards,
Markus

#5 lore raw

Re: [Powertop] Testing CERT links

In reply to Alexandra Yates
Quoted 1 line · Alexandra Yates

Still not available. See attached.

Both CERT links work for me here, it's a CNAME for meadow.red.cert.org.

Signature · 1 line
 Chris Samuel  :  http://www.csamuel.org/  :  Melbourne, VIC
#6 lore raw
In reply to SF Markus Elfring
Quoted 8 lines

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

Quoted 7 lines

Regards,
Markus
_______________________________________________
PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertop

Patch was added.

Thank you,
Alexandra.