Solved

Pointer to interrupt

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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use structures 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.

820 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