This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: v3.0.4 vs. v2.95.3, Solaris 8, basic_ostream/fstream weirdness
Wow, that was FAST!
>> include/rsdr_file.h:320: no matching function for call to
>> `std::basic_fstream<char, std::char_traits<char> >::write(unsigned
>> char*, unsigned int)'
Phil> It might be useful if you could post a bit of this code. Perhaps
Phil> line 320?
Roit! Sorry, all paranoid about proprietary-ness. Here's the snippet:
if(_data_section_been_set)
{
int seek_to_position;
int remember_incoming_position;
remember_incoming_position = _rsdr_input_file.tellg();
seek_to_position = _current_record_number * (_SIZEOF_HEADER + _sizeof_da\
ta_section);
_rsdr_input_file.seekp(seek_to_position,ios::beg);
_rsdr_input_file.write((unsigned char *) &_rsdr_data_record.header,sizeo\
f(RSDR_DATA_HEADER));
^^^^ line 320
_rsdr_input_file is declared as type 'fstream' in the private part of class
rsdr_file:
class rsdr_file {
private:
//Hardware byte order
const int _BIG_ENDIAN_;
const int _LITTLE_ENDIAN_;
//File section sizes
int _SIZEOF_HEADER;
//
File stream class
fstream _rsdr_input_file;
[.....]
Phil> The C++ standard points out (footnote 299, for what it's worth;
Phil> the focal point of many conversations in my office) that
Phil> ostream::write() is /not/ overloaded on signed versus unsigned
Phil> char. So it may be that you only need to do a cast in your call
Phil> to write(), like
Phil> f.write( (const char*) foo, .... );
Phil> or, more portably,
Phil> f.write( static_cast<const ostream::char_type*>(foo), .... );
Worth a try -- it's presently cast as unsigned char, so maybe that's
something that changed // is now enforced // whatever.
*crunch crunch* Well, that got rid of that problem. They seem to have
other problems as well, with 'setfill' not liking <<. I think I'll just
lay it back in their lap and tell them there are some convention changes
between 2.95.3 and 3.0.4 that they have to investigate and port to.
>> I've tried putting the bits/std_fstream.h in there, but that didn't
>> work.
Phil> Advice: stay out of the bits directory. :-)
Yep, I figured as much. ;) Actually, the bits/std_fstream.h was theirs--I
thought it was pretty awkward to bypass the 'fstream' include file, and
that's when I started realizing: "Looks like they're shooting themselves in
the foot here." I likened it to doing a #include <iso/stdio_iso.h> instead
of #include <stdio.h> ... although it might not be that drastic.
>> I've tried referencing these header files without the .h's, and that
>> didn't work.
Phil> That's actually the correct way to do it, but you then need to be
Phil> more strict about proper use of namespaces. The forms with .h
Phil> dump everything into the global namespace for backwards
Phil> contemptibility. The extensionless forms keep their declarations
*chuckle*
Phil> in std. For more, see
Phil> http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/howto.html#4
Excellent, thanks!
>> I'm presently working on installing DejaGnus so I can run the
>> testsuite for more insight.
Phil> I suggest finding a large brick wall and smashing your head into
Phil> it repeatedly. This is often less painful than installing
Phil> dejagnu from scratch...
I used to work in a big cement block. Now I'm in a new building with
windows. No brick walls. Hmm, maybe my monitor will suffice ..
>> laurel:smi-src>/usr/local/bin/g++ -v Reading specs from
>> /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0.4/specs Configured
>> with: ../configure --prefix=/usr/local
Phil> ^^^^^^^^^^^^^^^^^^^
Phil> For what it's worth, /usr/local is the default prefix.
Ya, I know, but I like to be explicit. Y'never know when that default
might change. ;)
Phil> -- If ye love wealth greater than liberty, the tranquility of
Phil> servitude greater than the animating contest for freedom, go home
Phil> and leave us in peace. We seek not your counsel, nor your arms.
Phil> Crouch down and lick the hand that feeds you; and may posterity
Phil> forget that ye were our countrymen. - Samuel Adams
Ooo! A new addition for http://rooth.org/plan.html ! Thanks. :)
--
Dave ``Dragon'' Michaels | "I wonder what news is doing..."
Raytheon IS Unix Engineer | news@newshost <29> ps -fu news
dmichael@redwood.rsc.raytheon.com | news 18624 12367 2 0:00 makehistory
303-344-6840 | "News is making history."