Description: GCC 12 and big-endian fix
 Needs cleaning.
 .
 cbmc (5.84.0-5) unstable; urgency=low
 .
   * Fix further portability problems
Author: Michael Tautschnig <mt@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2023-06-16

--- cbmc-5.84.0.orig/regression/cbmc/Struct_Bytewise1/struct_bytewise.c
+++ cbmc-5.84.0/regression/cbmc/Struct_Bytewise1/struct_bytewise.c
@@ -1,18 +1,3 @@
-// Determine endianness.
-// Follows http://wiki.debian.org/ArchitectureSpecificsMemo
-
-#if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
-
-#if defined(__avr32__) || defined(__hppa__)    || defined(__m68k__) || \
-    defined(__mips__)  || defined(__powerpc__) || defined(__s390__) || \
-    defined(__s390x__) || defined(__sparc__)
-
-#define __BIG_ENDIAN__
-
-#endif
-
-#endif
-
 typedef struct my_struct
 {
   // We hope these are 32 bit each on all architectures,
@@ -37,7 +22,7 @@ int main()
   logAppl.b=0x01000002;
   CopyBuffer((unsigned char *)&logAppl);
 
-  #ifdef __BIG_ENDIAN__
+  #if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
   assert(arrayTmp[0]==0);
   assert(arrayTmp[1]==0);
   assert(arrayTmp[2]==0);
--- cbmc-5.84.0.orig/src/util/cmdline.cpp
+++ cbmc-5.84.0/src/util/cmdline.cpp
@@ -296,7 +296,13 @@ bool cmdlinet::parse_arguments(int argc,
         return true;
       }
 
+			// Work around spurious GCC 12 warning about optnr being uninitialised.
+#pragma GCC diagnostic push
+#ifndef __clang__
+#  pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#endif
       options[*optnr].isset = true;
+#pragma GCC diagnostic pop
 
       if(options[*optnr].hasval)
       {
