Change in osmo-ci[master]: scripts: add a script for checking presence of <endian.h>

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Fri Oct 29 22:10:28 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/26045 )


Change subject: scripts: add a script for checking presence of <endian.h>
......................................................................

scripts: add a script for checking presence of <endian.h>

Change-Id: I6a1e7fc2e96f42fc596f47b4d7f1ac6c61d834b6
---
A scripts/verify_endian_header.sh
1 file changed, 23 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/45/26045/1

diff --git a/scripts/verify_endian_header.sh b/scripts/verify_endian_header.sh
new file mode 100755
index 0000000..9dcbc0e
--- /dev/null
+++ b/scripts/verify_endian_header.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Usage: ./verify_endian_header.sh $(find . -name "*.[hc]")
+
+HEADER="osmocom/core/endian.h"
+COUNT=0
+
+for f in $*; do
+	# Obviously, ignore the header file defining the macros
+	if [ $(basename $f) = $(basename $HEADER) ]; then
+		continue
+	fi
+	# Match files using either of OSMO_IS_{LITTLE,BIG}_ENDIAN
+	if grep -q "OSMO_IS_\(LITTLE\|BIG\)_ENDIAN" $f; then
+		# The header file must be included
+		if ! grep -q "#include <$HEADER>" $f; then
+			echo "File '$f' does not #include <$HEADER>"
+			COUNT=$((COUNT + 1))
+		fi
+	fi
+done
+
+exit $COUNT

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/26045
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I6a1e7fc2e96f42fc596f47b4d7f1ac6c61d834b6
Gerrit-Change-Number: 26045
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211029/01439b36/attachment.htm>


More information about the gerrit-log mailing list