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 165945 - Unresolved identifiers in 'Profiling Demo' (implicit declaration of function ‘gettimeofday’)
Summary: Unresolved identifiers in 'Profiling Demo' (implicit declaration of function ...
Status: RESOLVED WORKSFORME
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-25 13:02 UTC by soldatov
Modified: 2012-12-18 12:12 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 soldatov 2009-05-25 13:02:58 UTC
Platform: Linux
Scenario:
- Create 'Profiling Demo' sample
- Open common.c file
==> 'gettimeofday' is marked as unresolved identifier (implicit declaration)
- Add '#include <sys/time.h>' line and save file
==> file has not unresolved identifiers
- Delete '#include <sys/time.h>' line and save file
==> file has not unresolved identifiers. Why we have differ in 1st and 3rd case?

/usr/bin/gmake -f nbproject/Makefile-Default.mk SUBPROJECTS= .build-conf
gmake[1]: Entering directory `/export/NB/ProfilingDemo_1'
/usr/bin/gmake  -f nbproject/Makefile-Default.mk dist/Default/GNU-Linux-x86/profilingdemo_1
gmake[2]: Entering directory `/export/NB/ProfilingDemo_1'
mkdir -p build/Default/GNU-Linux-x86
rm -f build/Default/GNU-Linux-x86/spinlock.o.d
gcc    -c -g -Wall -MMD -MP -MF build/Default/GNU-Linux-x86/spinlock.o.d -o build/Default/GNU-Linux-x86/spinlock.o
spinlock.c
spinlock.c: In function ‘threadfunc’:
spinlock.c:98: warning: control reaches end of non-void function
spinlock.c: In function ‘spinlock_demo’:
spinlock.c:116: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘long int’
mkdir -p build/Default/GNU-Linux-x86
rm -f build/Default/GNU-Linux-x86/sequential.o.d
gcc    -c -g -Wall -MMD -MP -MF build/Default/GNU-Linux-x86/sequential.o.d -o build/Default/GNU-Linux-x86/sequential.o
sequential.c
mkdir -p build/Default/GNU-Linux-x86
rm -f build/Default/GNU-Linux-x86/parallel.o.d
gcc    -c -g -Wall -MMD -MP -MF build/Default/GNU-Linux-x86/parallel.o.d -o build/Default/GNU-Linux-x86/parallel.o
parallel.c
parallel.c: In function ‘threadfunc’:
parallel.c:60: warning: control reaches end of non-void function
parallel.c: In function ‘parallel_demo’:
parallel.c:95: warning: too many arguments for format
mkdir -p build/Default/GNU-Linux-x86
rm -f build/Default/GNU-Linux-x86/barrier.o.d
gcc    -c -g -Wall -MMD -MP -MF build/Default/GNU-Linux-x86/barrier.o.d -o build/Default/GNU-Linux-x86/barrier.o barrier.c
barrier.c: In function ‘threadfunc’:
barrier.c:61: warning: control reaches end of non-void function
mkdir -p build/Default/GNU-Linux-x86
rm -f build/Default/GNU-Linux-x86/common.o.d
gcc    -c -g -Wall -MMD -MP -MF build/Default/GNU-Linux-x86/common.o.d -o build/Default/GNU-Linux-x86/common.o common.c
common.c: In function ‘work_run_usrcpu’:
common.c:58: warning: implicit declaration of function ‘gettimeofday’
common.c: In function ‘work_run_syscpu’:
common.c:81: warning: suggest parentheses around assignment used as truth value
common.c: In function ‘work_run_getmem’:
common.c:104: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long unsigned int’
common.c:113: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long unsigned int’
mkdir -p build/Default/GNU-Linux-x86
rm -f build/Default/GNU-Linux-x86/rwlock.o.d
gcc    -c -g -Wall -MMD -MP -MF build/Default/GNU-Linux-x86/rwlock.o.d -o build/Default/GNU-Linux-x86/rwlock.o rwlock.c
rwlock.c: In function ‘readerfunc’:
rwlock.c:71: warning: control reaches end of non-void function
rwlock.c: In function ‘writerfunc’:
rwlock.c:84: warning: control reaches end of non-void function
mkdir -p build/Default/GNU-Linux-x86
rm -f build/Default/GNU-Linux-x86/mutex.o.d
gcc    -c -g -Wall -MMD -MP -MF build/Default/GNU-Linux-x86/mutex.o.d -o build/Default/GNU-Linux-x86/mutex.o mutex.c
mutex.c: In function ‘threadfunc’:
mutex.c:99: warning: control reaches end of non-void function
mutex.c: In function ‘mutex_demo’:
mutex.c:135: warning: too many arguments for format
mkdir -p build/Default/GNU-Linux-x86
rm -f build/Default/GNU-Linux-x86/join.o.d
gcc    -c -g -Wall -MMD -MP -MF build/Default/GNU-Linux-x86/join.o.d -o build/Default/GNU-Linux-x86/join.o join.c
join.c: In function ‘threadfunc’:
join.c:61: warning: control reaches end of non-void function
mkdir -p build/Default/GNU-Linux-x86
rm -f build/Default/GNU-Linux-x86/main.o.d
gcc    -c -g -Wall -MMD -MP -MF build/Default/GNU-Linux-x86/main.o.d -o build/Default/GNU-Linux-x86/main.o main.c
mkdir -p dist/Default/GNU-Linux-x86
gcc     -o dist/Default/GNU-Linux-x86/profilingdemo_1 build/Default/GNU-Linux-x86/spinlock.o
build/Default/GNU-Linux-x86/sequential.o build/Default/GNU-Linux-x86/parallel.o build/Default/GNU-Linux-x86/barrier.o
build/Default/GNU-Linux-x86/common.o build/Default/GNU-Linux-x86/rwlock.o build/Default/GNU-Linux-x86/mutex.o
build/Default/GNU-Linux-x86/join.o build/Default/GNU-Linux-x86/main.o -lpthread 
gmake[2]: Leaving directory `/export/NB/ProfilingDemo_1'
gmake[1]: Leaving directory `/export/NB/ProfilingDemo_1'
BUILD SUCCESSFUL (total time: 859ms)
Comment 1 Alexey Vladykin 2009-10-27 11:59:17 UTC
There are two parts:
1. compiler warnings in ProfilingDemo, which is really a SIMPLEFIX
2. instable error highlighting, which could be a bit harder to fix...
Comment 2 Alexey Vladykin 2009-10-27 18:50:19 UTC
The SIMPLEFIX part (various compiler warnings) extracted as a separate issue 175543.
Comment 3 Alexander Simon 2010-05-21 07:20:23 UTC
fixed in NB6.9 development cycle.
Comment 4 Alexey Vladykin 2010-05-21 08:33:33 UTC
Indeed, compiler warnings are fixed. But there is the second part of the original bug report which is still reproducible:
1. Create ProfilingDemo, open common.c, verify that gettimeofday() is resolved.
2. Comment out "#include <sys/time.h>" in common.c and common.h.  gettimeofday() is still resolved, although its declaration is not included any more. Reparsing project does not help to make gettimeofday() unresolved.
3. Exit IDE, delete code model cache, open IDE. gettimeofday() is unresolved, correctly.
Comment 5 Alexander Simon 2012-12-18 12:12:38 UTC
second scenario does not reproduced