From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 487CFE00961; Sun, 5 Apr 2015 07:44:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, SPF_HELO_PASS autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.0 SPF_HELO_PASS SPF: HELO matches SPF record * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 HTML_MESSAGE BODY: HTML included in message Received: from tritech.se (tritech.se [46.59.120.190]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id B7DF5E002F9 for ; Sun, 5 Apr 2015 07:44:02 -0700 (PDT) Received: from post.tritech.se (post.tritech.se [10.75.60.100]) by tritech.se (8.14.3/8.14.3) with ESMTP id t35Ehuqu017637 for ; Sun, 5 Apr 2015 16:44:01 +0200 Received: from POST.tritech.se ([10.75.60.100]) by post ([10.75.60.100]) with mapi id 14.02.0387.000; Sun, 5 Apr 2015 16:43:55 +0200 From: Rickard Bremer To: "yocto@yoctoproject.org" Thread-Topic: Parse Error Thread-Index: AdBvrvB6a4/WcBpuTb+F0qJAnb7z4g== Date: Sun, 5 Apr 2015 14:43:54 +0000 Message-ID: Accept-Language: sv-SE, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [83.248.164.111] MIME-Version: 1.0 Subject: Parse Error X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2015 14:44:07 -0000 Content-Language: sv-SE Content-Type: multipart/alternative; boundary="_000_E0AAEDF37958A64591322A370796C7897C5CE9post_" --_000_E0AAEDF37958A64591322A370796C7897C5CE9post_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, Since this morning i've been starting up a new build from scratch. I cant f= igure out howto proceed : $ bitbake core-image-minimal ERROR: ParseError at /var/lib/jenkins/workspace/thesis-build-yocto/meta-ope= nembedded/meta-oe/recipes-core/packagegroups/packagegroup-basic.bb:12: Coul= d not inherit file classes/bluetooth.bbclass Summary: There was 1 ERROR message shown, returning a non-zero exit code. Best Regards Rickard --_000_E0AAEDF37958A64591322A370796C7897C5CE9post_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello,

Since this morning i've been starting up a new build from scratch. I cant f= igure out howto proceed :

$ bitbake core-image-minimal
ERROR: ParseError at /var/lib/jenkins/workspace/thesis-build-yocto/meta-ope= nembedded/meta-oe/recipes-core/packagegroups/packagegroup-basic.bb:12: Coul= d not inherit file classes/bluetooth.bbclass

Summary: There was 1 ERROR message shown, returning a non-zero exit code.

Best Regards
Rickard
--_000_E0AAEDF37958A64591322A370796C7897C5CE9post_-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 57607E00963; Sun, 5 Apr 2015 12:39:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,WEIRD_PORT autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.220.180 listed in list.dnswl.org] * 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 HTML_MESSAGE BODY: HTML included in message Received: from mail-qk0-f180.google.com (mail-qk0-f180.google.com [209.85.220.180]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id A86F7E002F9 for ; Sun, 5 Apr 2015 12:39:16 -0700 (PDT) Received: by qku63 with SMTP id 63so10728513qku.3 for ; Sun, 05 Apr 2015 12:39:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=+v639htbXPyeiR8yMWZrgCXszsFWqGqpthZEiQDifsA=; b=T8jVxmj88q/jb1Phbf+oH77yE+RgGaGmRoiXg9OEd7fXGkNSEoohEZkLzOe7yRhGH3 YpbHUENxkU4kVsqpUWaXypydkGErsSaGkwUL9SOnjqz/QI3QWx0Fvqeov8xG8IlUP3pR H7kv9TOpgiWgokjRVVshEacghLvJjmBuSZ4CASHwnk+gI1I9IXFSwbw8IFHzEFyDQJ6D 9/tbm+zLo25bOtERsUhwtTXPg4Bx3LeJriCR2bJ1TzGNtPaCLqfU3jzMcrDkzRYrXSMK HkHY8GBvEjegdXtd4irmzF+pzmXGks9+Dq5d5l47ChagYmDIKg8vclwLpyb7r+3a4jfp GoxQ== X-Gm-Message-State: ALoCoQmCHjPHc838B0NRpxHUmRkhnmcRD2XN76Ao+BZ4NkFJORh3ySxntwPhm9XJVY+uFRmjNKe2 X-Received: by 10.55.49.147 with SMTP id x141mr22498902qkx.23.1428262755116; Sun, 05 Apr 2015 12:39:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.102.203 with HTTP; Sun, 5 Apr 2015 12:38:54 -0700 (PDT) In-Reply-To: References: From: "Burton, Ross" Date: Sun, 5 Apr 2015 20:38:54 +0100 Message-ID: To: Rickard Bremer Cc: "yocto@yoctoproject.org" Subject: Re: Parse Error X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2015 19:39:17 -0000 Content-Type: multipart/alternative; boundary=001a11471b642a3ed50512ff56cf --001a11471b642a3ed50512ff56cf Content-Type: text/plain; charset=UTF-8 On 5 April 2015 at 15:43, Rickard Bremer wrote: > $ bitbake core-image-minimal > ERROR: ParseError at > /var/lib/jenkins/workspace/thesis-build-yocto/meta-openembedded/meta-oe/recipes-core/packagegroups/ > packagegroup-basic.bb:12: Could not inherit file classes/bluetooth.bbclass > Looks like your meta-oe is from master but your oe-core is from a release branch? bluetooth.bbclass is only in oe-core master (and the shortly to be released 1.8 aka "Fido"). Ross --001a11471b642a3ed50512ff56cf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On 5 April 2015 at 15:43, Rickard Bremer <rickard.bremer@tritech.s= e> wrote:
$ bitbake core-= image-minimal
ERROR: ParseError at /var/lib/jenkins/workspace/thesis-build-yocto/meta-ope= nembedded/meta-oe/recipes-core/packagegroups/packagegroup-basic.bb:12: Could not inh= erit file classes/bluetooth.bbclass

Looks l= ike your meta-oe is from master but your oe-core is from a release branch? = =C2=A0bluetooth.bbclass is only in oe-core master (and the shortly to be re= leased 1.8 aka "Fido").

Ross
--001a11471b642a3ed50512ff56cf-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 8A682E007A0; Mon, 6 Apr 2015 23:24:55 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE, MIME_HTML_ONLY, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-HAM-Report: * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (cca_liam_maps[at]mail.com) * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 HTML_MESSAGE BODY: HTML included in message * 0.7 MIME_HTML_ONLY BODY: Message only has text/html MIME parts * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [74.208.4.200 listed in list.dnswl.org] Received: from mout.gmx.com (mout.gmx.com [74.208.4.200]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 1C635E006E5 for ; Mon, 6 Apr 2015 23:24:54 -0700 (PDT) Received: from [212.103.144.57] by 3capp-mailcom-lxa05.server.lan (via HTTP); Tue, 7 Apr 2015 08:24:51 +0200 MIME-Version: 1.0 Message-ID: From: "Nejc Urbajs" To: yocto@yoctoproject.org Date: Tue, 7 Apr 2015 08:24:51 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K0:wgKNofK+70vIltNvz5er6Pb7ird3ivvbRnphqSRtIVP jT4rGLRSXNXh7LT5fq43zOp8psdN5LyO4SecqknPwpeB/t4Rr8 k8WZqMewnoXw3HpHXrH2stOqc2FbLPe9V2I7tct/DDeyzedhWq gLp6ZYOJsWFVsKxDFc6Hku/u5800sRbaDGr1kdfS18+nWsMerY XlJHjzFFe5KLEMzCMf3ewV0rKvQTkFvDNcG4e3nj15cmGuGat1 QUxqH33YzeXkNjnzlF3fk3kf2niY9g9szbWum8lnEz/zKuB4gw 2kNAqRqvu/xvm1teK9OyyQHH0do X-UI-Out-Filterresults: notjunk:1; Subject: Re: Parse Error X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2015 06:24:55 -0000 Content-Type: text/html; charset=UTF-8
I had the same issue and the problem was indeed what Ross suggested. Moving completely to the master branch sorted things out for me.
Have a nice one!
From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id B803AE007A0; Mon, 6 Apr 2015 23:42:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE, MIME_HTML_ONLY, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [74.208.4.200 listed in list.dnswl.org] * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (cca_liam_maps[at]mail.com) * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 HTML_MESSAGE BODY: HTML included in message * 0.7 MIME_HTML_ONLY BODY: Message only has text/html MIME parts Received: from mout.gmx.com (mout.gmx.com [74.208.4.200]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id BA775E006E5 for ; Mon, 6 Apr 2015 23:42:12 -0700 (PDT) Received: from [212.103.144.57] by 3capp-mailcom-lxa05.server.lan (via HTTP); Tue, 7 Apr 2015 08:42:12 +0200 MIME-Version: 1.0 Message-ID: From: "Nejc Urbajs" To: cca_liam_maps@mail.com Date: Tue, 7 Apr 2015 08:42:12 +0200 Importance: normal Sensitivity: Normal References: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K0:eXK7k6VyFQWg3YO0WzVwugH93l6z2kAHMxi4z3moGGn o+yWqEM0EMMXi18wne3i1HhkKg0dcClXwmmqJeLf8zFIKLoBnX SnpKS3uG9rDMOo0dexlxisOzaZC1lG2ckJQ21a1Oqjm+40q6OS C0TxxOO8fOk1CS7XkURAcAcc0UOa6P5DXOXw68+y0q4hMJ9lWD s4FNpLu5u3c8TZhgK46/q+wj/ZtcENCGqTQcXhMmmWHyl6ZJRG SM6AVTyrFzDoOMHRSlNWSBJPz0KVXk79bXl/4IXXim5yGq/r54 9sSrW1VwLMHQtuOFXZIczF5aPrN X-UI-Out-Filterresults: notjunk:1; Cc: yocto@yoctoproject.org Subject: Re: Parse Error X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2015 06:42:15 -0000 Content-Type: text/html; charset=UTF-8
I see I messed up and started a new a thread instead of a replying to an exisitng one. Still strying to figure out how this mailing list works. Bear with me please. :-)
Thank you.
 
Sent: Tuesday, April 07, 2015 at 8:24 AM
From: cca_liam_maps@mail.com
To: yocto@yoctoproject.org
Subject: Re: [yocto] Parse Error
I had the same issue and the problem was indeed what Ross suggested. Moving completely to the master branch sorted things out for me.
Have a nice one!
From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 8ECAEE007A0; Mon, 6 Apr 2015 23:47:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE, MIME_HTML_ONLY, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [74.208.4.200 listed in list.dnswl.org] * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (cca_liam_maps[at]mail.com) * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 HTML_MESSAGE BODY: HTML included in message * 0.7 MIME_HTML_ONLY BODY: Message only has text/html MIME parts Received: from mout.gmx.com (mout.gmx.com [74.208.4.200]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id EA246E006E5 for ; Mon, 6 Apr 2015 23:47:34 -0700 (PDT) Received: from [212.103.144.57] by 3capp-mailcom-lxa05.server.lan (via HTTP); Tue, 7 Apr 2015 08:47:32 +0200 MIME-Version: 1.0 Message-ID: From: "Nejc Urbajs" To: ross.burton@intel.com Date: Tue, 7 Apr 2015 08:47:32 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K0:wY8ldAc/tKDMrScvhvbzMic2wu/5SjxwiL0TKXJEyJz DAyN1xZDcJelluYihdSWLjvqQTErEmefHfSrtNiVWyFot/7avj 8tMtirIiBsVaBsMoH93YGkTr8miIJyOuPqbsvlqz/VutA2vtlB wOT7dXimD8ru9lgdyE0Pa0FmwtMgStjdO2zg1K+n1O4+kHWGwP WeVZ/tn1nZlyVQF7bmWw7c9JVzMVfA3ujkVK2YxcvSaX2ECw02 rQPQNIdfzbiNoOD+n08YNeRR5I++9wRe1cwpf4ZZEmRSsYMB6C ZKp39uBo6gEoPWo5XNtYTaCAcBw X-UI-Out-Filterresults: notjunk:1; Cc: yocto@yoctoproject.org Subject: Re: Parse Error X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2015 06:47:37 -0000 Content-Type: text/html; charset=UTF-8
I had the same issue and the problem was indeed what Ross suggested. Moving completely to the master branch sorted things out for me.
Have a nice one!
From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 30927E00832; Mon, 6 Apr 2015 23:52:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE, MIME_HTML_ONLY, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [74.208.4.200 listed in list.dnswl.org] * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (cca_liam_maps[at]mail.com) * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 HTML_MESSAGE BODY: HTML included in message * 0.7 MIME_HTML_ONLY BODY: Message only has text/html MIME parts Received: from mout.gmx.com (mout.gmx.com [74.208.4.200]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id DF6E8E006E5 for ; Mon, 6 Apr 2015 23:52:25 -0700 (PDT) Received: from [212.103.144.57] by 3capp-mailcom-lxa05.server.lan (via HTTP); Tue, 7 Apr 2015 08:52:24 +0200 MIME-Version: 1.0 Message-ID: From: "Nejc Urbajs" To: cca_liam_maps@mail.com Date: Tue, 7 Apr 2015 08:52:24 +0200 Importance: normal Sensitivity: Normal References: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K0:vg2JhScg3/w5r3gYKOqcc0eSn0awKO8dwxdPRwESuj0 IUXCpCRPpR9qOmV+Q/igc59RuNqIA0HEx41LoY7Q7TEZqzMfeC 0o+8i+6sadYFu7maTrfIRn3k/RRdMsDOqtBZZabVVxBGhQcQQp GksNetjnh1urhjEa0/8USAs92KK9RNDqj//KLCg6CsEbjRcwYz 6mTKpN7hOgIKQ8kK+dgP1dsfaT+VJifDZR8j/qn/ZUEVubAZ8A 8afiL/Ilay0nkiIOqY+UmMnbFSwB4yMuKYZeATiZ15DZtqCgpT Ype1Ea8hn79I9lI1Hf6N1VphUDZ X-UI-Out-Filterresults: notjunk:1; Cc: yocto@yoctoproject.org Subject: Re: Parse Error X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2015 06:52:28 -0000 Content-Type: text/html; charset=UTF-8
I'm about to give up. Can someone please explain how I take a thread I find in the archives and reply to it. I seem to keep creating new ones instead of replying to existing ones.
 
Thank you very much.
 
Sent: Tuesday, April 07, 2015 at 8:47 AM
From: <cca_liam_maps@mail.com>
To: ross.burton@intel.com
Cc: rickard.bremer@tritech.se, yocto@yoctoproject.org
Subject: Re: [yocto] Parse Error
I had the same issue and the problem was indeed what Ross suggested. Moving completely to the master branch sorted things out for me.
Have a nice one!
From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ankit Jain Subject: parse error Date: Sun, 26 Sep 2004 15:32:52 +0100 (BST) Sender: linux-c-programming-owner@vger.kernel.org Message-ID: <20040926143252.39003.qmail@web52902.mail.yahoo.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7BIT Return-path: List-Id: Content-Type: text/plain; charset="us-ascii" To: linux prg hi i could not understand why compiler has put semi colon before else due t owhich this parse error comes.... thanks #define exch(x,y) { int tmp; tmp=x; x=y; y=tmp; } However that wouldn't work in some cases. The following code is meant to be an if-statement with two branches: if(x>y) exch(x,y); // Branch 1 else do_something(); // Branch 2 But it would be interpreted as an if-statement with only one branch: if(x>y) { // Single-branch if-statement!!! int tmp; // The one and only branch consists tmp = x; // of the block. x = y; y = tmp; } ; // empty statement else // ERROR!!! "parse error before else" do_something(); ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elias Athanasopoulos Subject: Re: parse error Date: Sat, 25 Sep 2004 09:29:01 +0300 Sender: linux-c-programming-owner@vger.kernel.org Message-ID: <20040925062900.GC1997@velka.phys.uoa.gr> References: <20040926143252.39003.qmail@web52902.mail.yahoo.com> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <20040926143252.39003.qmail@web52902.mail.yahoo.com> List-Id: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Ankit Jain Cc: linux prg On Sun, Sep 26, 2004 at 03:32:52PM +0100, Ankit Jain wrote: > hi > > i could not understand why compiler has put semi colon > before else due t owhich this parse error comes.... > > thanks > > > #define exch(x,y) { int tmp; tmp=x; x=y; y=tmp; } #define exch(x,y) do { int tmp; tmp=x; x=y; y=tmp; } while(0); Regards, -- University of Athens I bet the human brain Physics Department is a kludge --Marvin Minsky From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Huber, George K RDECOM CERDEC STCD SRI" Subject: RE: parse error Date: Mon, 27 Sep 2004 11:58:38 -0400 Sender: linux-c-programming-owner@vger.kernel.org Message-ID: Mime-Version: 1.0 Return-path: List-Id: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: 'Ankit Jain' , linux prg Ankit wrote: >i could not understand why compiler has put semi colon >before else due t owhich this parse error comes.... >#define exch(x,y) { int tmp; tmp=x; x=y; y=tmp; } Remember that macro expansion occures early in the compilation process (it occures in step 4 if I remember correctly). In this case a simple text replacement is performed. >However that wouldn't work in some cases. The following code is >meant to be an if-statement with two branches: if(x>y) exch(x,y); // Branch 1 else do_something(); // Branch 2 As written, assuming exch() is a function you would have a two branch if statement. However, because exch is a macro, this is what is passed from the c preprocessor to the compiler (because exch(..) is replaced with the body of the defination: if(x>y) { int tmp; tmp=x; x=y; y=tmp;}; else do_something(); and you have a one-brance if statement along with a parse error of an unassociated elst statement. There are two fixes to this problem. The first is to remove the semi-colon after the if statement: if(x>y) exch(x,y) else do_something(); This will expand to what you expect. This is probably the least satisfactory fix. The better fix would be to wrap the entire macro in a do-while loop, leaving the semicolon in place (i.e. this construct allows a macro call to be treated like a function). #define exch(x,y) do{int tmp; tmp=x; x=y; y=tmp;}while(0) if(x>y) do{int tmp; tmp=x; x=y; y=tmp;}while(0); else ... You should be aware that while macros are powerful, they can be tricky to use. As an example, consifer what would happen with this statement exch(a, b+4) George From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan-Benedict Glaw Subject: Re: parse error Date: Tue, 28 Sep 2004 08:14:51 +0200 Sender: linux-c-programming-owner@vger.kernel.org Message-ID: <20040928061451.GC847@lug-owl.de> References: <20040926143252.39003.qmail@web52902.mail.yahoo.com> <20040925062900.GC1997@velka.phys.uoa.gr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+xNpyl7Qekk2NvDX" Return-path: Content-Disposition: inline In-Reply-To: <20040925062900.GC1997@velka.phys.uoa.gr> List-Id: To: linux prg --+xNpyl7Qekk2NvDX Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, 2004-09-25 09:29:01 +0300, Elias Athanasopoulos wrote in message <20040925062900.GC1997@velka.phys.uoa.gr>: > On Sun, Sep 26, 2004 at 03:32:52PM +0100, Ankit Jain wrote: > > hi > >=20 > > i could not understand why compiler has put semi colon > > before else due t owhich this parse error comes.... > >=20 > > thanks > >=20 > > =20 > > #define exch(x,y) { int tmp; tmp=3Dx; x=3Dy; y=3Dtmp; } >=20 > #define exch(x,y) do { int tmp; tmp=3Dx; x=3Dy; y=3Dtmp; } while(0); Nearly:-) Omit the last semicolon to make it work... MfG, JBG --=20 Jan-Benedict Glaw jbglaw@lug-owl.de . +49-172-7608481 = _ O _ "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg = _ _ O fuer einen Freien Staat voll Freier B=FCrger" | im Internet! | im Irak! = O O O ret =3D do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA)= ); --+xNpyl7Qekk2NvDX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFBWQFbHb1edYOZ4bsRAidRAJ9GRRzBc1QooiW4CmNS3tbggQ7IhQCeJim7 +XIUZCuRMTIb3/50hMr2rlw= =uASP -----END PGP SIGNATURE----- --+xNpyl7Qekk2NvDX-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elias Athanasopoulos Subject: Re: parse error Date: Mon, 27 Sep 2004 01:51:55 +0300 Sender: linux-c-programming-owner@vger.kernel.org Message-ID: <20040926225155.GA823@velka.phys.uoa.gr> References: <20040926143252.39003.qmail@web52902.mail.yahoo.com> <20040925062900.GC1997@velka.phys.uoa.gr> <20040928061451.GC847@lug-owl.de> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <20040928061451.GC847@lug-owl.de> List-Id: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux prg On Tue, Sep 28, 2004 at 08:14:51AM +0200, Jan-Benedict Glaw wrote: > On Sat, 2004-09-25 09:29:01 +0300, Elias Athanasopoulos > wrote in message <20040925062900.GC1997@velka.phys.uoa.gr>: > > On Sun, Sep 26, 2004 at 03:32:52PM +0100, Ankit Jain wrote: > > > hi > > > > > > i could not understand why compiler has put semi colon > > > before else due t owhich this parse error comes.... > > > > > > thanks > > > > > > #define exch(x,y) { int tmp; tmp=x; x=y; y=tmp; } > > > > #define exch(x,y) do { int tmp; tmp=x; x=y; y=tmp; } while(0); > > Nearly:-) Omit the last semicolon to make it work... Right. :-) Actually after a lot of C Coding it's too difficult to develop the habit to omit a last semicolon in one line of code. Regards, -- University of Athens I bet the human brain Physics Department is a kludge --Marvin Minsky