[aesop] #38: bracketed single-line if statements
#38: bracketed single-line if statements --------------------------------+------------------------------------------- Reporter: gcdanie@… | Type: defect Status: new | Priority: don't know Component: don't know | Version: Keywords: | --------------------------------+------------------------------------------- When compiling a non-blocking function (e.g., without a __blocking identifier), should that function contain a single line if statement enclosed in brackets (as below), the aesop compiler will error (as below). if (condition) { return something; } aatree.c:79:1: error: stray ‘#’ in program aatree.c:79:7: warning: statement with no effect [-Wunused-value] aatree.c:79:10: error: expected ‘;’ before string constant aatree.c:81:31: error: ‘dir’ undeclared (first use in this function) aatree.c:81:31: note: each undeclared identifier is reported only once for each function it appears in aatree.c: In function ‘__ae_worker_treenode_traverse’: -- Ticket URL: <http://trac.mcs.anl.gov/projects/aesop/ticket/38> aesop <https://trac.mcs.anl.gov/projects/aesop> The Aesop Language
#38: bracketed single-line if statements --------------------------------+------------------------------------------- Reporter: gcdanie@… | Type: defect Status: new | Priority: don't know Component: don't know | Version: Keywords: | --------------------------------+------------------------------------------- Comment(by dkimpe): Do you have a small program for this demonstrating this? Normally, non-blocking functions are not modified and pass through without change. -- Ticket URL: <https://trac.mcs.anl.gov/projects/aesop/ticket/38#comment:1> aesop <https://trac.mcs.anl.gov/projects/aesop> The Aesop Language
I do. Attached, find a tar file containing an implementation of an AA tree, with a single blocking function (a traversal). On line 77, in the function void *node_find(), the if statement "if (eqkey(&t->key, &key) == 1)" has brackets around the return statement contained inside. Unmodified, this will not build. If you modify the code to exclude the brackets, the code will build. On 10/17/12 9:48 AM, "aesop" <[email protected]> wrote:
#38: bracketed single-line if statements --------------------------------+----------------------------------------- -- Reporter: gcdanie@Š | Type: defect Status: new | Priority: don't know Component: don't know | Version: Keywords: | --------------------------------+----------------------------------------- --
Comment(by dkimpe):
Do you have a small program for this demonstrating this? Normally, non-blocking functions are not modified and pass through without change.
-- Ticket URL: <https://trac.mcs.anl.gov/projects/aesop/ticket/38#comment:1> aesop <https://trac.mcs.anl.gov/projects/aesop> The Aesop Language _______________________________________________ ASG mailing list [email protected] https://lists.mcs.anl.gov/mailman/listinfo/asg
#38: bracketed single-line if statements --------------------------------+------------------------------------------- Reporter: gcdanie@… | Type: defect Status: new | Priority: don't know Component: don't know | Version: Keywords: | --------------------------------+------------------------------------------- Comment(by mlcurry): I have successfully triggered this bug with the following example. #include <aesop/aesop.h> #include <stdio.h> void test(void) { if (1 > 0) { printf(“Hello.\n”); } int i; return; } __blocking int aemain(int argc, char **argv) { test(); return 0; } aesop_main_set(remain); -- Ticket URL: <https://trac.mcs.anl.gov/projects/aesop/ticket/38#comment:2> aesop <https://trac.mcs.anl.gov/projects/aesop> The Aesop Language
participants (2)
-
aesop -
Danielson, Geoffrey Charles