473,487 Members | 2,680 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

why this program is wrong on Tru64 OS ?

Hi,

When I run the program below on Tru64:

#include <string>

int main()
{
char *cad="hola";
string s1 = 1 ? string(cad, 0, 2) : "";
}
I get the next error:

Unaligned access pid=28959 <a.out> va=0x3ff8000f40c pc=0x1200059c8
ra=0x120005944 inst=0xa403ffe8
Resources lost(coredump)
These are the OS and compiler versions:

sqocfms01:jdiaz:/tmp>uname -a
OSF1 sqocfms01.esm.cpqcorp.net V5.1 1885 alpha
sqocfms01:jdiaz:/tmp>cxx -V
Compaq C++ V6.3-008 for Compaq Tru64 UNIX V5.1A (Rev. 1885)
Compiler Driver V6.3-008 (cxx) cxx Driver
Thands in advance,
Jose Luis
Jul 22 '05 #1
2 1728
"jose luis fernandez diaz" <jo**********************@yahoo.es> wrote...
When I run the program below on Tru64:

#include <string>

int main()
{
char *cad="hola";
string s1 = 1 ? string(cad, 0, 2) : "";
}
I get the next error:
The program is not supposed to compile according to the rules
of the Standard C++ language. 'string' is supposed to be
declared in the 'std' namespace.

Unaligned access pid=28959 <a.out> va=0x3ff8000f40c pc=0x1200059c8
ra=0x120005944 inst=0xa403ffe8
Resources lost(coredump)
These are the OS and compiler versions:

sqocfms01:jdiaz:/tmp>uname -a
OSF1 sqocfms01.esm.cpqcorp.net V5.1 1885 alpha
sqocfms01:jdiaz:/tmp>cxx -V
Compaq C++ V6.3-008 for Compaq Tru64 UNIX V5.1A (Rev. 1885)
Compiler Driver V6.3-008 (cxx) cxx Driver


OS-specific and compiler-specific behaviour cannot be explained from
the language standpoint, and this newsgroup deals with language only.
Perhaps you will find more information in a newsgroup dedicated to
your OS or your compiler.

IOW, there is nothing in the program itself (except the 'std::' thing)
that would suggest the alignment problems, and there is nothing in the
C++ language specification that would help solving your problem.

Oh, try declaring 'cad' as a pointer to _const_ char:

char const* cad = "hola";

(not that it should make much difference, though)

Victor

Jul 22 '05 #2
jo**********************@yahoo.es (jose luis fernandez diaz) wrote in message news:<c2**************************@posting.google. com>...
Hi,

When I run the program below on Tru64:

#include <string>

int main()
{
char *cad="hola";
string s1 = 1 ? string(cad, 0, 2) : "";
}
I get the next error:

Unaligned access pid=28959 <a.out> va=0x3ff8000f40c pc=0x1200059c8
ra=0x120005944 inst=0xa403ffe8
Resources lost(coredump)
These are the OS and compiler versions:

sqocfms01:jdiaz:/tmp>uname -a
OSF1 sqocfms01.esm.cpqcorp.net V5.1 1885 alpha
sqocfms01:jdiaz:/tmp>cxx -V
Compaq C++ V6.3-008 for Compaq Tru64 UNIX V5.1A (Rev. 1885)
Compiler Driver V6.3-008 (cxx) cxx Driver
Thands in advance,
Jose Luis

I remember that we had this problem with a Compaq CXX: somehow he doesn't
get the types correctly. The following should fix your problem
(not the CXX bug:-):

string s1 = 1 ? std::string(cad, 0, 2) : std::string("");

In our source we are using the empty string first, but it shouldn't matter,
please let me know as I do no more have a CXX compiler available.

Regards, Stephan
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1330
by: the_rev_dharma_roadkill | last post by:
I've have some fun getting DCOracle2 (python-to-oracle interface) going on HP/Compaq Tru64 with Oracle8i Release 3 (oracle 8.1.7). I'd like to share an answer/bug-fix with you: After un-tarring...
5
2127
by: Heuguette Bostic | last post by:
I am attempting to compile Python 2-3.4 on Tru64 UNIX V4.0F. Whenever Iissue the make command, the following errors are output: -pthread -ieee -std -Olimit 1500 -DNDEBUG -O -I. -I./Include...
0
891
by: bill.oldroyd | last post by:
I am running Python 2.4.1 on a HP Tru64 Unix system. When try to carry out a DNS query as follows : t = socket.getaddrinfo("labs.bl.uk",None) I get the error message socket.error: (41,...
2
1603
by: Nikola Milutinovic | last post by:
Hi guys. Building 7.4 "as we speak". I've run into one minor building bug. HW: DEC AlphaStation 200 OS: Digital UNIX 4.0D + SP9 PG: 7.4 sources When I choose to build "with threading...
3
2017
by: Nikola Milutinovic | last post by:
Hi guys. I have just had some problems resolved while building PostgreSQL 7.4.2 on Tru64 UNIX 5.1B. File "./src/backend/utils/adt/float.c" uses "NAN" on two spots. It ahs a fall-back...
0
1516
by: avidamani | last post by:
Hi, I have a c++ application in which I am using stringstream to convert integer/long to string. std::stringstream x; int y = 5; x << y; Whenever I do that I get an unalignedd access...
2
4835
by: avidamani | last post by:
Hi, I have a c++ application compiled using Compaq C++ V6.5-014 for Compaq Tru64 UNIX V5.1A (Rev. 1885) Compiler Driver V6.5-014 (cxx) cxx Driver The problem is that the application is...
2
19311
Banfa
by: Banfa | last post by:
Posted by Banfa The previous tutorial discussed what programming is, what we are trying to achieve, the answer being a list of instructions constituting a valid program. Now we will discuss how...
2
1556
by: Chedda | last post by:
everytime i try to compile and run the program, on the compiler it states on line where it says ofstream outfile("c:\\Users\\Michael\\Desktop\\Statistics.txt");#include <iostream> that theres an...
0
7106
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7181
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7349
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5442
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4874
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3076
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1381
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.