This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/14306] New: comparison of postype and size_t breaks ACE


All the versions of ACE I have tried do not compile. Newer gcc 3.4 snapshots
reject the file Logging_Strategy.cpp with a 

Logging_Strategy.cpp: In member function `virtual int
ACE_Logging_Strategy::handle_timeout(const ACE_Time_Value&, const void*)':
Logging_Strategy.cpp:371: error: `class std::streampos' used where a `size_t'
was expected.

error message. This is for the ace version 5.4.

I do not know what the standard says about the code appended below but all
compilers I have access to compile the source code without a warning. Therefore,
this problem might be a regression or ACE has to be fixed in a portable manner.

t.C

#include <bits/postypes.h>


int main()
{
    std::size_t max_size;
    
    std::streampos pos;
    
//  if ((size_t) this->log_msg_->msg_ostream ()->tellp () 
//      > this->max_size_) // ACE_wrappers/ace/Logging_strategy.cpp line 370

    if ((std::size_t) pos > max_size) return 42;

}

g++ -v t.C -W -Wall -save-temps
Reading specs from /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/specs
Configured with: ../gcc/configure --enable-threads=posix
--enable-languages=c,c++,f77,objc --enable-__cxa_atexit --enable-libstdcxx-debug
Thread model: posix
gcc version 3.4.0 20040225 (prerelease)
 /usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.0/cc1plus -E -quiet -v
-D_GNU_SOURCE t.C -mtune=pentiumpro -W -Wall -o t.ii
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory
"/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/i686-pc-linux-gnu
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/backward
 /usr/local/include
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/include
 /usr/include
End of search list.
 /usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.0/cc1plus -fpreprocessed t.ii
-quiet -dumpbase t.C -mtune=pentiumpro -auxbase t -W -Wall -version -o t.s
GNU C++ version 3.4.0 20040225 (prerelease) (i686-pc-linux-gnu)
	compiled by GNU C version 3.4.0 20040225 (prerelease).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64274
t.C: In function `int main()':
t.C:13: error: `class std::streampos' used where a `size_t' was expected

-- 
           Summary: comparison of postype and size_t breaks ACE
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: schmid at snake dot iap dot physik dot tu-darmstadt dot
                    de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]