Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect error on "upc_fence()" #59

Closed
PHHargrove opened this issue Feb 21, 2014 · 3 comments
Closed

incorrect error on "upc_fence()" #59

PHHargrove opened this issue Feb 21, 2014 · 3 comments

Comments

@PHHargrove
Copy link
Contributor

UPC specifies upc_fence as a statement, not a function. So, upc_fence() is not valid UPC. Take the following test code:

#include <upc.h>
void foo(void) { upc_fence(); }

With clangupc or with run upc2c directly get the expected failure:

$ clangupc test.upc 
test.upc:2:27: error: called object type 'void' is not a function or function pointer
void foo(void) { upc_fence(); }
                 ~~~~~~~~~^
1 error generated.

However, with upc2c via the upcc driver I get not only a substantially less understandable message, but the message INCORRECTLY says "upc_notify".

$ upcc test.upc 
upcc: error during translation: 
test.upc:2:27: error: expected ';' after upc_notify statement
void foo(void) { upc_fence(); }
                          ^
                          ;
1 error generated.

I am uncertain why the message is different via the upcc driver.

I am going to provide a patch (or branch?) for the error message if it is, as I suspect, just a cut-and-paste problem. I will look for others at the same time.

@PHHargrove
Copy link
Contributor Author

There were identical typos for upc_wait and upc_barrier and some related ones in the comments.
NOTE: the issue turns out to be entirely in clang-upc.

Proposed fix for all 5 typos is in PHHargrove/clang-upc@0e8824a
NOT creating a pull request.

@swatanabe
Copy link
Contributor

On 02/21/2014 02:11 PM, Paul H. Hargrove wrote:

I am uncertain why the message is different via the upcc driver.

The reason is that upc_fence appears to be defined as
a macro when calling upc2c or clangupc directly. Using
the upcc driver is suppressing the definition.

@nenadv
Copy link

nenadv commented Feb 25, 2014

Fixed by this commit in clang-upc clangupc/clang-upc@6d6c97f

@nenadv nenadv closed this as completed Feb 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants