Re: odd behavior with libcryptsetup.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I see this behaviour as well with gcc 4.6.3 using the libcryptset.h from git.

Some quick searching on Googe leads me to believe that size_t is supposed to be in stddef.h. Like you noted simply adding that fixes the compilation.

diff --git a/lib/libcryptsetup.h b/lib/libcryptsetup.h
index 2b10add..e4b384f 100644
--- a/lib/libcryptsetup.h
+++ b/lib/libcryptsetup.h
@@ -33,6 +33,7 @@
 extern "C" {
 #endif
 
+#include <stddef.h>
 #include <stdint.h>
 
 struct crypt_device; /* crypt device handle */

On Mon, May 28, 2012 at 12:42 AM, .. ink .. <mhogomchungu@xxxxxxxxx> wrote:
#include <libcryptsetup.h>

int main( void )
{
       return 0 ;
}

A source file with the above code named "crypt.c" errors out when
compiling it with the following command:

gcc -o crypt crypt.c -I/include

"libcryptsetup.h" is located at "'/include" in my distro.
gcc version is 4.5.1.

The compile pass if i add any standard library header i have tried
above the libcryptsetup.h header,if its below or not present, the
compilation fail with below error. I googled why this happens but
havent found anything. using cryptsetup version 1.4.2

Errors produced are below.

gcc -o crypt crypt.c -I/include
In file included from crypt.c:3:0:
/include/libcryptsetup.h:187:46: error: expected declaration
specifiers or ‘...’ before ‘size_t’
/include/libcryptsetup.h:336:2: error: expected
specifier-qualifier-list before ‘size_t’
In file included from crypt.c:3:0:
/include/libcryptsetup.h:380:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:474:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:492:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:493:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:501:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:537:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:539:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:573:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:574:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:576:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:577:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:584:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:586:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:606:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:608:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:686:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:706:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:707:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:716:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:738:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:770:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:772:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:785:2: error: expected declaration specifiers
or ‘...’ before ‘size_t’
/include/libcryptsetup.h:963:59: error: expected declaration
specifiers or ‘...’ before ‘size_t’
/include/libcryptsetup.h:974:33: error: expected declaration
specifiers or ‘...’ before ‘size_t’
_______________________________________________
dm-crypt mailing list
dm-crypt@xxxxxxxx
http://www.saout.de/mailman/listinfo/dm-crypt

_______________________________________________
dm-crypt mailing list
dm-crypt@xxxxxxxx
http://www.saout.de/mailman/listinfo/dm-crypt

[Index of Archives]     [Device Mapper Devel]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux