Fedora Linux Support Community & Resources Center
  #1  
Old 23rd September 2010, 07:33 AM
merkava's Avatar
merkava Offline
Registered User
 
Join Date: Jul 2010
Location: Tabriz, Iran
Age: 23
Posts: 75
linuxfedorafirefox
Locally Declared Labels

Hi guys.

in the Locally Declared Labels section in "The Definitive Guide to GCC" book there is block of code:
Code:
#define SEARCH(array, target)
({
    __label__ found;
    typeof (target) _SEARCH_target = (target);
    typeof (*(array)) *_SEARCH_array = (array);
    int i, j;
    int value;
    for (i = 0; i < max; i++)
        for (j = 0; j < max; j++)
            if (_SEARCH_array[i][j] == _SEARCH_target)
                { value = i; goto found; }
        value = -1;
    found:
    value;
})
What the hell is the last line?
Code:
value;
__________________
Best Regards
MERKAVA
Reply With Quote
  #2  
Old 23rd September 2010, 10:00 AM
Jamwa Offline
Registered User
 
Join Date: Jan 2008
Location: Nairobi Kenya
Posts: 540
linuxfedorafirefox
Re: Locally Declared Labels

You have locally declared a label called "found" with a value of "value"

Look at this:
Code:
    found: <-- Ends with a FULL COLON
    value; <-- Ends with a semicolon
which can be written as
Code:
    found: value;
Reply With Quote
Reply

Tags
gcc, locally declared labels

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
basename re-declared in string.h woofn Using Fedora 1 23rd November 2009 06:07 AM
‘system’ was not declared in this scope Anji_fedora Programming & Packaging 7 18th April 2009 05:00 PM
create on object whose name will be declared at run time. cbarmpar Programming & Packaging 6 14th September 2008 05:33 PM
I can run php remotely but not locally jonhumphrey Installation and Live Media 4 1st March 2006 03:53 PM
VSFTPD only connects locally mick-porter Using Fedora 5 19th July 2005 09:15 PM


Current GMT-time: 18:03 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat