Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Pointer to interrupt

Posted on 1997-05-23
2
Medium Priority
?
720 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 200 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…
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 reading files 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.

722 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