pointer to error

pointer to error

Iget this error when I try to compile a c source program with icc. It compiles easily and quickly under gcc.

error: expression must have (pointer-to-) function type
ISGN = SIGN( 1.0, ZBND-ZTRG );
^

I do not know what it means and I searched the Intel forum to no avail. How do I get rid of this error?

Any help appreciated. Thanks in advance.

Newport_j

6 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

We need more information.

What is the type of ISGN?
What is the SIGN? Is it a function? A macro? A class member?

- Barry

Okay, let me give an example where it is clear what themeaning is:

error: expression must have (pointer-to-) function type
Pz = sqrt(Pz2);

or

error: expression must have (pointer-to-) function type
COSO = cos()cd);

I believe that wil make it obvious what sqrt or cos is.

Newport_j

Actually it's not obvious what sqrt or cos is, and it can be tricky to track down. The problem is that before the line of interest, there may be a definition like:

float sqrt = 1.41423;

that makes sqrt a variable instead of a function, which would cause the sort of error you are seeing. The definition may be hidden in a header file brought in by an include directive, and may be conditional on the particular compiler because of #if or #ifdef directives. Or it could be a macro.

Fortunately, there is a way to track down the definition or macro replacement games. Run icc has you normally would, but add the option "-E". This will cause the compiler to do all #include processing and macro substiution, and send the result to standard output. So given a source file like a.c, run "icc -E a.c >a.txt". Then bring up a.txt in an editor and find the line that is causing problems. Look for sqrt in that file and see how it is defined. If you cannot find it, it was a macro, and instead look for the line corresponding to where the compiler complained. The text file can be large, so one trick I use is to mark the region of interest with a strange variable name. E.g., you might try writing "Pz = sqrt(Pz2); {int banana=0;}" and look for "banana" in the output file. The text file will also have lines like:

# 37 "/usr/include/stdio.h" 1 3

that indicate from which other files lines are coming from. That line says that subsequent lines are from /usr/include/stdio.h , starting at line 37 of that file. I forget what the "1 3" means.

Hi Newport_j,

If you still have problems after upgrading to update 6 or later, let me know, but I think that's likely the problem here as well.

Brandon Hewitt
Technical Consulting Engineer

For 1:1 technical support: http://premier.intel.com

Software Product Support info: http://www.intel.com/software/support

Where can I download Upgrade 6? I would like to get rid of the errors that I am getting. If a newer version of Intel Composer is available then let me know. Where is the website to download it?

Thanks in advance.

Newport_j

Kommentar hinterlassen

Bitte anmelden, um einen Kommentar hinzuzufügen. Sie sind noch nicht Mitglied? Jetzt teilnehmen