Solved

Pointer to interrupt

Posted on 1997-05-23
2
703 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
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…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

895 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

16 Experts available now in Live!

Get 1:1 Help Now