Solved

Pointer to interrupt

Posted on 1997-05-23
2
711 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

632 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