Problems with getvect/setvect under Borland C 3.1

D

Dmytro Bablinyuk

I have an old DOS serial communication program which I want to
compile.
The program I told was designed under Borland C 3.1 and therefore I am
trying to compile it under Borland C 3.1.
During compilation I have a error for the line oldvect =
getvect(comp.intr):
Error: Cannot convert 'void (interrupt *)(...)' to 'void (interrupt
*)()'

The same problem for setvect.
I don't understand this. The help shows that everything should be
right - getvect takes one integer parameter.
What's wrong with that?

Could somebody please help me with this, may be I am missing
something.

Thank you
 
A

Artie Gold

Dmytro said:
I have an old DOS serial communication program which I want to
compile.
The program I told was designed under Borland C 3.1 and therefore I am
trying to compile it under Borland C 3.1.
During compilation I have a error for the line oldvect =
getvect(comp.intr):
Error: Cannot convert 'void (interrupt *)(...)' to 'void (interrupt
*)()'

The same problem for setvect.
I don't understand this. The help shows that everything should be
right - getvect takes one integer parameter.
What's wrong with that?

Could somebody please help me with this, may be I am missing
something.
You're dealing with non-standard extensions here, so is
the wrong place to ask.

Try one of the Borland groups (or their website).

HTH,
--ag

[BTW, you should *really* read the FAQ for c.l.c, at:
http://www.eskimo.com/~scs/C-faq/top.html]
 
P

Peter Pichler

Dmytro Bablinyuk said:
I have an old DOS serial communication program which I want to
compile.
The program I told was designed under Borland C 3.1 and therefore I am
trying to compile it under Borland C 3.1.
During compilation I have a error for the line oldvect =
getvect(comp.intr):
Error: Cannot convert 'void (interrupt *)(...)' to 'void (interrupt
*)()'

The same problem for setvect.
I don't understand this. The help shows that everything should be
right - getvect takes one integer parameter.
What's wrong with that?

As Artie Gold told you, this is OT on comp.lang.c, but my guess is that
your oldvect is declared as 'void (interrupt *)()' whereas getvect() has
a type 'void (interrupt *)(...)'. Try delaring oldvect according to the
getvect()'s prototype.
 
H

Horst Kraemer

I have an old DOS serial communication program which I want to
compile.
The program I told was designed under Borland C 3.1 and therefore I am
trying to compile it under Borland C 3.1.
During compilation I have a error for the line oldvect =
getvect(comp.intr):
Error: Cannot convert 'void (interrupt *)(...)' to 'void (interrupt
*)()'

The same problem for setvect.
I don't understand this. The help shows that everything should be
right - getvect takes one integer parameter.
What's wrong with that?

You are mixing languages. In Borland C an "interrupt" has type

void (interrupt*)()

while in Borland C++ it has type

void (interrupt*)(...)

This affects the parameter type of setvect and the return type of
getvect which change in the same way according to the language used.
You obviously compiled your program as a C++ program and not as a C
program because according to the compiler's message 'oldvec' is
declared as a "C interrupt" and getvect returns a "C++ interrupt".
 
Joined
Oct 19, 2010
Messages
1
Reaction score
0
Hello,
I am trying to play with C++.
I have a pgrm in 'C' which manage the UART's interrupts.
In 'C' > void interrupt(*old_vector)(); //Place to save old COMM vector
old_vector = getvect(intnum); //Then install a new one
setvect(intnum, &com_interrupt_driver);
setvevt(intnum, old_vector); //.. and the comm

All works fine in 'C', but when I compile in C++, it returns these errors :
Cannot convert 'void (interrupt*)(...) to void (intrrupt*)()'
Cannot convert 'void (inteerupt*)() to void (interrupt*(...)'
Type mismatch in parameter __isr in call setvect'

I suppose I am mixing C & C++.
Could somebody can help me to write the correct statements in C++ ?
Many thanks to all of you for your answer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,954
Messages
2,570,113
Members
46,700
Latest member
VYJJanette

Latest Threads

Top