[Bug c++/35884] defining __need_size_t before including cstddef causes error

2008-04-10 Thread stdin at stdin dot me dot uk


--- Comment #2 from stdin at stdin dot me dot uk  2008-04-11 03:36 ---
You define __need_size_t when you want to pull in the definition of size_t but
not other typedefs/functions. It's the standard way to get the size_t type.


-- 

stdin at stdin dot me dot uk changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|INVALID |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35884



[Bug c++/35884] New: defining __need_size_t before including cstddef causes error

2008-04-09 Thread stdin at stdin dot me dot uk
When you define __need_size_t before including cstddef it only pulls in
size_t, but the cstddef header expects ptrdiff_t there too and fails.
sample code:
--
#define __need_size_t
#include cstddef
main() {}
--
error message produced by g++:
$ g++ main.cpp
In file included from main.cpp:2:
/usr/include/c++/4.3/cstddef:55: error: ‘::ptrdiff_t’ has not been declared


-- 
   Summary: defining __need_size_t before including cstddef causes
error
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: trivial
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: stdin at stdin dot me dot uk
 GCC build triplet: i486-linux-gnu
  GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35884