For Programmers: Free Programming Magazines  


Home > Archive > Fortran > January 2006 > warning #266: function declared implicitly









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author warning #266: function declared implicitly
emammendes@gmail.com

2006-01-29, 6:59 pm

Hello

I am calling fortran from my a c program. Although an executbale is
created the compiler returns

warning #266: function declared implicitly

How can I get rid of this warning message?

Many thanks

Ed

Rich Townsend

2006-01-29, 6:59 pm

emammendes@gmail.com wrote:
> Hello
>
> I am calling fortran from my a c program. Although an executbale is
> created the compiler returns
>
> warning #266: function declared implicitly
>
> How can I get rid of this warning message?
>
> Many thanks
>
> Ed
>


See answer #534.
Rich Townsend

2006-01-29, 6:59 pm

Rich Townsend wrote:
> emammendes@gmail.com wrote:
>
>
> See answer #534.


....by which I mean: I wouldn't expect too much assistance based on the little
information you've given. How about telling us a little more? For instance, what
compiler(s) and platform are you using. What is the declaration of the Fortran
routine? If the code is sufficiently small, can you post it here?

cheers,

Rich
Richard Maine

2006-01-29, 6:59 pm

<emammendes@gmail.com> wrote:

> I am calling fortran from my a c program. Although an executbale is
> created the compiler returns
>
> warning #266: function declared implicitly
>
> How can I get rid of this warning message?


In addition to the other Rich's comments (both the humorous one and the
elaboration), I suspect that this message is from the C compiler
complaining about the C code. Inthat case, this would be a C question
instead of a Fortran one. The C compiler won't know or care that it is a
Fortran function. Do whatever you'd do in C anyway.

It would not surprise me at all if you also had other problems than just
this warning, but you haven't given enough information even about this
warning, much less about the other problems that I can see only through
my crystal ball. There are more possible issues than I could possibly
elaborate on in one posting. Since avoiding this warning message is
among the simplest related things, it leaves me suspicious that some of
the other issues are also there, but not yet showing.

Of course, I'm just guessing that it is a messsage from the C compiler,
because your question didn't even specify that much, just saying "the"
compiler, when two of them are involved.

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
emammendes@gmail.com

2006-01-29, 6:59 pm

Hello

My sincere apologies. A bit of info: icc is the C compiler and ifort
is the fortran counterpart.

Fortran:

subroutine calnpr(nsuby,nsubu,ny,nu,ne,L,nall)
integer nyu,nyue,ia,i,j
integer ny(nsuby,nsuby),nu(nsuby,nsubu),ne(nsuby
,nsuby)
integer L(nsuby), nall(nsuby)

C:

calnpr_(&nsuby,&nsubu,ny,nu,ne,degree,nall);

That is all!

Btw, it works just fine. Better than that, it is a mex that can be
called within matlab!

Many thanks

Ed




Richard Maine wrote:
> <emammendes@gmail.com> wrote:
>
>
> In addition to the other Rich's comments (both the humorous one and the
> elaboration), I suspect that this message is from the C compiler
> complaining about the C code. Inthat case, this would be a C question
> instead of a Fortran one. The C compiler won't know or care that it is a
> Fortran function. Do whatever you'd do in C anyway.
>
> It would not surprise me at all if you also had other problems than just
> this warning, but you haven't given enough information even about this
> warning, much less about the other problems that I can see only through
> my crystal ball. There are more possible issues than I could possibly
> elaborate on in one posting. Since avoiding this warning message is
> among the simplest related things, it leaves me suspicious that some of
> the other issues are also there, but not yet showing.
>
> Of course, I'm just guessing that it is a messsage from the C compiler,
> because your question didn't even specify that much, just saying "the"
> compiler, when two of them are involved.
>
> --
> Richard Maine | Good judgement comes from experience;
> email: last name at domain . net | experience comes from bad judgement.
> domain: summertriangle | -- Mark Twain


emammendes@gmail.com

2006-01-29, 6:59 pm

The message is from the C compiler.

Ed

James Van Buskirk

2006-01-29, 6:59 pm

<emammendes@gmail.com> wrote in message
news:1138569826.356730.140980@g44g2000cwa.googlegroups.com...

> Fortran:


> subroutine calnpr(nsuby,nsubu,ny,nu,ne,L,nall)
> integer nyu,nyue,ia,i,j
> integer ny(nsuby,nsuby),nu(nsuby,nsubu),ne(nsuby
,nsuby)
> integer L(nsuby), nall(nsuby)


> C:


> calnpr_(&nsuby,&nsubu,ny,nu,ne,degree,nall);


I would have given the C compiler a prototype like:

/* File: my_Fortran_stuff.h */

#ifndef _MY_FORTRAN_STUFF_
#define _MY_FORTRAN_STUFF_

void calnpr_(int* nsuby, int* nsubu, int* ny, int* nu, int* ne,
int* L, int* nall);

#endif
/* End of file: my_Fortran_stuff.h */

And then somewhere near the top of your C file you could have
a line such as:

#include "my_Fortran_stuff.h"

--
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end


emammendes@gmail.com

2006-01-29, 6:59 pm

Hello

Many thanks. No more warnings.

Thanks a lot!

Ed

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com