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

Summary: support #pragma weak
Product: cnd Reporter: Alexander Simon <alexvsimon>
Component: Code ModelAssignee: issues@cnd <issues>
Status: NEW ---    
Severity: blocker    
Priority: P4    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 108501, 134091    

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.