Solved

Pointer to interrupt

Posted on 1997-05-23
2
701 Views
Last Modified: 2012-06-27
I have some code that works, but it annoys me that I get a compilation warning.

This is a DOS program written with MSVC 1.52, large memory model.

I declare a pointer to an interrupt as so:-

void (_cdecl _interrupt _far *_based(_segname("_CODE"))oldClockInt)(void) = NULL;

and then use it in the code as so:-

oldClockInt = _dos_getvect(8U);

The warning I get is:-
warning C4113: function parameter lists differed

It annoys the hell out of me to get warnings. Other than turning the warning off, how can I define this pointer correctly?
0
Comment
Question by:icd
2 Comments
 
LVL 1

Accepted Solution

by:
jct052097 earned 50 total points
ID: 1250516
I cannot test it 'cos I have no MSVC, but in BC would work.

================================
void (_cdecl _interrupt _far
       *_based(_segname("_CODE"))oldClockInt)(void) = NULL;

oldClockInt = (void (_cdecl _interrupt far
       *_based(_segname("_CODE")) )(void)) _dos_getvect(8U);
================================

The unic problem is that _dos_getvect returns void*.
You may like to "typedef" that type of data, as to refer to it easyly.

Please, tell me if it works.


0
 
LVL 5

Author Comment

by:icd
ID: 1250517
Thanks. That did it.
I could not see the solution myself since I was thinking it was the declaration rather than the call that was in error.

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now