Bug#505954: FTBFS with GCC 4.4: missing #include
Package: apt
Version: 0.7.18
User: debian-gcc@lists.debian.org
Usertags: ftbfs-gcc-4.4
Tags: patch
Your package fails to build with the upcoming GCC 4.4. Version 4.4
has not been released yet but I'm building with a snapshot in order
to find errors and give people an advance warning.
GCC 4.4 cleaned up some more C++ headers. You always have to #include
headers directly and cannot rely for things to be included indirectly.
You can reproduce this problem with gcc-snapshot from unstable.
> Automatic build of apt_0.7.18 on em64t by sbuild/amd64 0.53
...
> Compiling contrib/sha256.cc to ../build/obj/apt-pkg/sha256.opic
> In file included from contrib/sha256.cc:32:
> ../build/include/apt-pkg/sha256.h:48: error: 'uint32_t' does not name a type
> ../build/include/apt-pkg/sha256.h:49: error: 'uint32_t' does not name a type
> ../build/include/apt-pkg/sha256.h:50: error: 'uint8_t' does not name a type
> contrib/sha256.cc: In constructor 'SHA256Summation::SHA256Summation()':
> contrib/sha256.cc:246: error: 'struct sha256_ctx' has no member named 'state'
> contrib/sha256.cc:247: error: 'struct sha256_ctx' has no member named 'state'
> contrib/sha256.cc:248: error: 'struct sha256_ctx' has no member named 'state'
> contrib/sha256.cc:249: error: 'struct sha256_ctx' has no member named 'state'
> contrib/sha256.cc:250: error: 'struct sha256_ctx' has no member named 'state'
> contrib/sha256.cc:251: error: 'struct sha256_ctx' has no member named 'state'
> contrib/sha256.cc:252: error: 'struct sha256_ctx' has no member named 'state'
> contrib/sha256.cc:253: error: 'struct sha256_ctx' has no member named 'state'
> contrib/sha256.cc:254: error: 'struct sha256_ctx' has no member named 'count'
> contrib/sha256.cc:254: error: 'struct sha256_ctx' has no member named 'count'
> contrib/sha256.cc:255: error: 'struct sha256_ctx' has no member named 'buf'
> contrib/sha256.cc:255: error: 'struct sha256_ctx' has no member named 'buf'
> contrib/sha256.cc: In member function 'bool SHA256Summation::Add(const u8*, long unsigned int)':
> contrib/sha256.cc:267: error: 'struct sha256_ctx' has no member named 'count'
> contrib/sha256.cc:270: error: 'struct sha256_ctx' has no member named 'count'
> contrib/sha256.cc:271: error: 'struct sha256_ctx' has no member named 'count'
> contrib/sha256.cc:272: error: 'struct sha256_ctx' has no member named 'count'
> contrib/sha256.cc:279: error: 'struct sha256_ctx' has no member named 'buf'
> contrib/sha256.cc:280: error: 'struct sha256_ctx' has no member named 'state'
> contrib/sha256.cc:280: error: 'struct sha256_ctx' has no member named 'buf'
> contrib/sha256.cc:283: error: 'struct sha256_ctx' has no member named 'state'
> contrib/sha256.cc:290: error: 'struct sha256_ctx' has no member named 'buf'
> contrib/sha256.cc: In member function 'SHA256SumValue SHA256Summation::Result()':
> contrib/sha256.cc:304: error: 'struct sha256_ctx' has no member named 'count'
> contrib/sha256.cc:309: error: 'struct sha256_ctx' has no member named 'count'
> contrib/sha256.cc:316: error: 'struct sha256_ctx' has no member named 'count'
> contrib/sha256.cc:334: error: 'struct sha256_ctx' has no member named 'state'
> make[2]: *** [../build/obj/apt-pkg/sha256.opic] Error 1
> make[2]: Leaving directory `/build/tbm/apt-0.7.18/apt-pkg'
--- apt-pkg/acquire.cc~ 2008-11-16 18:02:20.000000000 +0000
+++ apt-pkg/acquire.cc 2008-11-16 18:02:28.000000000 +0000
@@ -22,6 +22,7 @@
#include <apti18n.h>
+#include <cstdio>
#include <iostream>
#include <sstream>
--- build/include/apt-pkg/sha256.h~ 2008-11-16 18:01:00.000000000 +0000
+++ build/include/apt-pkg/sha256.h 2008-11-16 18:01:13.000000000 +0000
@@ -14,6 +14,7 @@
#ifndef APTPKG_SHA256_H
#define APTPKG_SHA256_H
+#include <stdint.h>
#include <string>
#include <cstring>
#include <algorithm>
--
Martin Michlmayr
http://www.cyrius.com/
Reply to: