Bug#847757: testdisk FTBFS on mips: common.h:128:2: error: initializer element is not constant

2017-01-10 Thread Jean-Michel Kelbert
Le 09/01/17 à 09:23 Daniel Knezevic (daniel.kneze...@imgtec.com) écrivait :
> Hi Christophe,
> 
> I have tested your patch, the package builds successfully for mips.

Hello,

Thanks for both the patch & the testing. I just uploaded a new package which 
will fix
the issue.

Regards

-- 
Jean-Michel Kelbert


signature.asc
Description: PGP signature


Bug#847757: testdisk FTBFS on mips: common.h:128:2: error: initializer element is not constant

2017-01-09 Thread Daniel Knezevic
Hi Christophe,

I have tested your patch, the package builds successfully for mips.


Bug#847757: testdisk FTBFS on mips: common.h:128:2: error: initializer element is not constant

2016-12-19 Thread Christophe GRENIER

On Mon, 19 Dec 2016, Daniel Knezevic wrote:


Forwarded: https://github.com/cgsecurity/testdisk/pull/15
The problem was in bitwise with signed values in le32 macro.
With attached patch I was able to build testdisk successfully on mips.


I have extended the patch to the other macros. Can you test it ?
Thanks

Christophe
--
   ,-~~-.___. ._.
  / |  ' \| |.   Christophe GRENIER
 (  ) 0   | || gren...@cgsecurity.org
  \_/-, ,'| ||
  !_!-v---v--.
 /  \-'~;  ..   TestDisk & PhotoRec
/  __/~| ._-""|||   Data Recovery
  =(  _|_||||   https://www.cgsecurity.orgdiff -ru testdisk/src/common.h ../testdisk-7.1-WIP/src/common.h
--- testdisk/src/common.h   2016-12-11 16:19:08.775022745 +0100
+++ ../testdisk-7.1-WIP/src/common.h2016-12-19 18:06:00.436972452 +0100
@@ -447,19 +447,19 @@
 (((x)&0x00ff)<<8))
 #define le24(x)  (x)
 #define le32(x)  (x)
-#define be32(x)  x)&0xff00L)>>24)| \
-(((x)&0x00ffL)>>8)  | \
-(((x)&0xff00L)<<8)  | \
-(((x)&0x00ffL)<<24))
+#define be32(x)  x)&0xff00UL)>>24)| \
+(((x)&0x00ffUL)>>8)  | \
+(((x)&0xff00UL)<<8)  | \
+(((x)&0x00ffUL)<<24))
 #define le64(x)  (x)
-#define be64(x)  x)&0xff00LL)>>56)   | \
-(((x)&0x00ffLL)>>40)| \
-(((x)&0xff00LL)>>24)| \
-(((x)&0x00ffLL)>>8) | \
-(((x)&0xff00LL)<<8) | \
-(((x)&0x00ffLL)<<24)| \
-(((x)&0xff00LL)<<40)| \
-(((x)&0x00ffLL)<<56))
+#define be64(x)  x)&0xff00ULL)>>56)   | \
+(((x)&0x00ffULL)>>40)| \
+(((x)&0xff00ULL)>>24)| \
+(((x)&0x00ffULL)>>8) | \
+(((x)&0xff00ULL)<<8) | \
+(((x)&0x00ffULL)<<24)| \
+(((x)&0xff00ULL)<<40)| \
+(((x)&0x00ffULL)<<56))
 #else /* bigendian */
 #define le16(x)  x)&0xff00)>>8)  | \
 (((x)&0x00ff)<<8))
@@ -468,19 +468,19 @@
 #define le24(x) x) & 0x00ffUL) << 16) | \
 ((x) & 0xff00UL)| \
 (((x) & 0x00ffUL) >> 16))
-#define le32(x)  x)&0xff00L)>>24)| \
-(((x)&0x00ffL)>>8)  | \
-(((x)&0xff00L)<<8)  | \
-(((x)&0x00ffL)<<24))
+#define le32(x)  x)&0xff00UL)>>24)| \
+(((x)&0x00ffUL)>>8)  | \
+(((x)&0xff00UL)<<8)  | \
+(((x)&0x00ffUL)<<24))
 #define be32(x)  (x)
-#define le64(x)  x)&0xff00LL)>>56)   | \
-(((x)&0x00ffLL)>>40)| \
-(((x)&0xff00LL)>>24)| \
-(((x)&0x00ffLL)>>8) | \
-(((x)&0xff00LL)<<8) | \
-(((x)&0x00ffLL)<<24)| \
-(((x)&0xff00LL)<<40)| \
-(((x)&0x00ffLL)<<56))
+#define le64(x)  x)&0xff00ULL)>>56)   | \
+(((x)&0x00ffULL)>>40)| \
+(((x)&0xff00ULL)>>24)| \
+(((x)&0x00ffULL)>>8) | \
+(((x)&0xff00ULL)<<8) | \
+(((x)&0x00ffULL)<<24)| \
+(((x)&0xff00ULL)<<40)| \
+(((x)&0x00ffULL)<<56))
 #define be64(x)  (x)
 #endif
 #ifndef HAVE_SNPRINTF


Bug#847757: testdisk FTBFS on mips: common.h:128:2: error: initializer element is not constant

2016-12-19 Thread Daniel Knezevic
Forwarded: https://github.com/cgsecurity/testdisk/pull/15

The problem was in bitwise with signed values in le32 macro.

With attached patch I was able to build testdisk successfully on mips.
--- testdisk-7.0.orig/src/common.h
+++ testdisk-7.0/src/common.h
@@ -466,10 +466,10 @@ time_t td_ntfs2utc (int64_t ntfstime);
 #define le24(x) x) & 0x00ffUL) << 16) | \
 ((x) & 0xff00UL)| \
 (((x) & 0x00ffUL) >> 16))
-#define le32(x)  x)&0xff00L)>>24)| \
-(((x)&0x00ffL)>>8)  | \
-(((x)&0xff00L)<<8)  | \
-(((x)&0x00ffL)<<24))
+#define le32(x)  x)&0xff00UL)>>24)| \
+(((x)&0x00ffUL)>>8)  | \
+(((x)&0xff00UL)<<8)  | \
+(((x)&0x00ffUL)<<24))
 #define be32(x)  (x)
 #define le64(x)  x)&0xff00LL)>>56)   | \
 (((x)&0x00ffLL)>>40)| \


Bug#847757: testdisk FTBFS on mips: common.h:128:2: error: initializer element is not constant

2016-12-13 Thread Daniel Knezevic
I tried Christophe's patch. It does not fix the build.
Package still FTBFS with "initializer element is not constant" error.

Currently gcc-6 is used as default compiler, by changing the compiler to gcc-5
testdisk builds successfully.


Bug#847757: testdisk FTBFS on mips: common.h:128:2: error: initializer element is not constant

2016-12-11 Thread Christophe GRENIER

On Sun, 11 Dec 2016, Adrian Bunk wrote:


Source: testdisk
Version: 7.0-2
Severity: serious

https://buildd.debian.org/status/logs.php?pkg=testdisk=mips

...
In file included from partgpt.c:45:0:
common.h:128:2: error: initializer element is not constant
 
((efi_guid_t){le32(0x516e7cb4),le16(0x6ecf),le16(0x11d6),0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}})
 ^
partgpt.c:80:5: note: in expansion of macro 'GPT_ENT_TYPE_FREEBSD'
  { GPT_ENT_TYPE_FREEBSD,  "FreeBSD"  },
^~~~
common.h:128:2: note: (near initialization for 'gpt_sys_types[2].part_type')
 
((efi_guid_t){le32(0x516e7cb4),le16(0x6ecf),le16(0x11d6),0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}})
 ^
partgpt.c:80:5: note: in expansion of macro 'GPT_ENT_TYPE_FREEBSD'
  { GPT_ENT_TYPE_FREEBSD,  "FreeBSD"  },
^~~~
...


Is the compilation fixed if "const efi_guid_t" is used ?
See patch in attachment.
Regards,
Christophe
--
   ,-~~-.___. ._.
  / |  ' \| |.   Christophe GRENIER
 (  ) 0   | || gren...@cgsecurity.org
  \_/-, ,'| ||
  !_!-v---v--.
 /  \-'~;  ..   TestDisk & PhotoRec
/  __/~| ._-""|||   Data Recovery
  =(  _|_||||   https://www.cgsecurity.orgdiff -ru testdisk/src/common.h ../testdisk-7.1-WIP/src/common.h
--- testdisk/src/common.h   2016-01-23 09:35:54.053059545 +0100
+++ ../testdisk-7.1-WIP/src/common.h2016-12-11 15:41:40.594247811 +0100
@@ -119,97 +119,97 @@
 #define PXBOX_FATX 1
 
 #defineGPT_ENT_TYPE_UNUSED \
-   
((efi_guid_t){le32(0x),le16(0x),le16(0x),0x00,0x00,{0x00,0x00,0x00,0x00,0x00,0x00}})
+   ((const 
efi_guid_t){le32(0x),le16(0x),le16(0x),0x00,0x00,{0x00,0x00,0x00,0x00,0x00,0x00}})
 #defineGPT_ENT_TYPE_EFI\
-   
((efi_guid_t){le32(0xc12a7328),le16(0xf81f),le16(0x11d2),0xba,0x4b,{0x00,0xa0,0xc9,0x3e,0xc9,0x3b}})
+   ((const 
efi_guid_t){le32(0xc12a7328),le16(0xf81f),le16(0x11d2),0xba,0x4b,{0x00,0xa0,0xc9,0x3e,0xc9,0x3b}})
 #defineGPT_ENT_TYPE_MBR\
-   
((efi_guid_t){le32(0x024dee41),le16(0x33e7),le16(0x11d3),0x9d,0x69,{0x00,0x08,0xc7,0x81,0xf3,0x9f}})
+   ((const 
efi_guid_t){le32(0x024dee41),le16(0x33e7),le16(0x11d3),0x9d,0x69,{0x00,0x08,0xc7,0x81,0xf3,0x9f}})
 #defineGPT_ENT_TYPE_FREEBSD\
-   
((efi_guid_t){le32(0x516e7cb4),le16(0x6ecf),le16(0x11d6),0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}})
+   ((const 
efi_guid_t){le32(0x516e7cb4),le16(0x6ecf),le16(0x11d6),0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}})
 #defineGPT_ENT_TYPE_FREEBSD_SWAP   \
-   
((efi_guid_t){le32(0x516e7cb5),le16(0x6ecf),le16(0x11d6),0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}})
+   ((const 
efi_guid_t){le32(0x516e7cb5),le16(0x6ecf),le16(0x11d6),0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}})
 #defineGPT_ENT_TYPE_FREEBSD_UFS\
-   
((efi_guid_t){le32(0x516e7cb6),le16(0x6ecf),le16(0x11d6),0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}})
+   ((const 
efi_guid_t){le32(0x516e7cb6),le16(0x6ecf),le16(0x11d6),0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}})
 #define GPT_ENT_TYPE_FREEBSD_ZFS   \
-   
((efi_guid_t){le32(0x516e7cb),le16(0x6ecf),le16(0x11d6),0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}})
+   ((const 
efi_guid_t){le32(0x516e7cb),le16(0x6ecf),le16(0x11d6),0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}})
 /*
  * The following is unused but documented here to avoid reuse.
  *
  * GPT_ENT_TYPE_FREEBSD_UFS2   \
- * 
((efi_guid_t){le32(0x516e7cb7),le16(0x6ecf),le16(0x11d6),0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}})
+ * ((const 
efi_guid_t){le32(0x516e7cb7),le16(0x6ecf),le16(0x11d6),0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}})
  */
 
 #defineGPT_ENT_TYPE_FREEBSD_VINUM  \
-   
((efi_guid_t){le32(0x516e7cb8),le16(0x6ecf),le16(0x11d6),0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}})
+   ((const 
efi_guid_t){le32(0x516e7cb8),le16(0x6ecf),le16(0x11d6),0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}})
 
 
 #defineGPT_ENT_TYPE_MS_RESERVED\
-   
((efi_guid_t){le32(0xe3c9e316),le16(0x0b5c),le16(0x4db8),0x81,0x7d,{0xf9,0x2d,0xf0,0x02,0x15,0xae}})
+   ((const 
efi_guid_t){le32(0xe3c9e316),le16(0x0b5c),le16(0x4db8),0x81,0x7d,{0xf9,0x2d,0xf0,0x02,0x15,0xae}})
 #defineGPT_ENT_TYPE_MS_BASIC_DATA  \
-   
((efi_guid_t){le32(0xebd0a0a2),le16(0xb9e5),le16(0x4433),0x87,0xc0,{0x68,0xb6,0xb7,0x26,0x99,0xc7}})
+   ((const 
efi_guid_t){le32(0xebd0a0a2),le16(0xb9e5),le16(0x4433),0x87,0xc0,{0x68,0xb6,0xb7,0x26,0x99,0xc7}})
 #defineGPT_ENT_TYPE_MS_LDM_METADATA\
-   
((efi_guid_t){le32(0x5808c8aa),le16(0x7e8f),le16(0x42e0),0x85,0xd2,{0xe1,0xe9,0x04,0x34,0xcf,0xb3}})
+   ((const 
efi_guid_t){le32(0x5808c8aa),le16(0x7e8f),le16(0x42e0),0x85,0xd2,{0xe1,0xe9,0x04,0x34,0xcf,0xb3}})
 #defineGPT_ENT_TYPE_MS_LDM_DATA\
-   

Bug#847757: testdisk FTBFS on mips: common.h:128:2: error: initializer element is not constant

2016-12-11 Thread Adrian Bunk
Source: testdisk
Version: 7.0-2
Severity: serious

https://buildd.debian.org/status/logs.php?pkg=testdisk=mips

...
In file included from partgpt.c:45:0:
common.h:128:2: error: initializer element is not constant
  
((efi_guid_t){le32(0x516e7cb4),le16(0x6ecf),le16(0x11d6),0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}})
  ^
partgpt.c:80:5: note: in expansion of macro 'GPT_ENT_TYPE_FREEBSD'
   { GPT_ENT_TYPE_FREEBSD,  "FreeBSD"  },
 ^~~~
common.h:128:2: note: (near initialization for 'gpt_sys_types[2].part_type')
  
((efi_guid_t){le32(0x516e7cb4),le16(0x6ecf),le16(0x11d6),0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}})
  ^
partgpt.c:80:5: note: in expansion of macro 'GPT_ENT_TYPE_FREEBSD'
   { GPT_ENT_TYPE_FREEBSD,  "FreeBSD"  },
 ^~~~
...