This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 135321 - support #pragma weak
Summary: support #pragma weak
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks: 108501 134091
  Show dependency tree
 
Reported: 2008-05-19 15:03 UTC by Alexander Simon
Modified: 2013-05-07 11:21 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Simon 2008-05-19 15:03:39 UTC
Code model should take into account pragma weak.
Code example:
---------------------------
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#pragma weak foo=_foo
void _foo(){
    printf("Arguments:\n");
}

int main(int argc, char**argv) {
    foo();
    for (int i = 0; i < argc; i++) {
        printf("%i: %s\n", i, argv[i]);
    }
    return 0;
}
---------------------------
Hyper link from function call foo() doesn't work.
Open Solaris project has many such code.
For example libc has definition of pthread_spin_init in source usr/src/lib/libc/port/threads/synch.c
---------------------------
#pragma weak pthread_spin_init = _pthread_spin_init
int
_pthread_spin_init(pthread_spinlock_t *lock, int pshared)
{
  ...
}
---------------------------
Header file pthread.h declares:
---------------------------
extern int pthread_spin_lock(pthread_spinlock_t *);
---------------------------
Comment 1 Alexander Pepin 2010-10-27 13:39:21 UTC
It's not targeted to the current release.