Re: Weak globals

Joe Pluta <joepluta-Kokj9vFzZubAKuVPhbf8BAC/[email protected]>
Newsgroups gmane.comp.lang.as400.c
Message-ID <[email protected]>
On 4/2/2019 7:43 AM, Joe Pluta wrote:
> |// TFOO1.CPP #include <stdio.h> void foo(); int main() { foo(); } // 
> TFOO2.CPP #include <stdio.h> #pragma weak foo__Fv void foo() { 
> printf("Foo called from compilation unit 2\n"); } // TFOO3.CPP 
> #include <stdio.h> void foo() { printf("Foo called from compilation 
> unit 3\n"); } |


That didn't look too good.  I'll try againL


// TFOO1.CPP

#include <stdio.h>

void foo();

int main()
{
        foo();
}

// TFOO2.CPP

#include <stdio.h>

#pragma weak foo__Fv
void foo()
{
        printf("Foo called from compilation unit 2\n");
}

// TFOO3.CPP

#include <stdio.h>

void foo()
{
        printf("Foo called from compilation unit 3\n");
}



-- 
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/c400-l
or email: [email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/c400-l.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.