public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/37764] New: Macro is not passed to openmp pragma when preprocessor is used
@ 2008-10-07 22:36 geir at cray dot com
2008-10-07 22:53 ` [Bug c/37764] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: geir at cray dot com @ 2008-10-07 22:36 UTC (permalink / raw)
To: gcc-bugs
The following openmp test case will not compile when it is first separating
processed by the preprocessor:
$ cat bug2885b.c
#include <omp.h>
#include <stdio.h>
#define NT 4
int actual_num_threads;
int main(){
#pragma omp parallel default(none) shared(actual_num_threads) num_threads(NT)
{
#pragma omp master
{
actual_num_threads = omp_get_num_threads();
}
}
printf("actual_num_threads: %d\n",actual_num_threads);
printf("num_threads NT: %d\n",NT);
return 0;
}
$ gcc --version
gcc (GCC) 4.3.1 20080606 (rpm:5)
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$
<Works: Not running through the preprocessor separately>
$ gcc -fopenmp bug2885b.c; ./a.out
actual_num_threads: 4
num_threads NT: 4
$
<Error: Running the preprocessor separately>
$ gcc -E -fopenmp bug2885b.c > bug.c
$ gcc -fopenmp bug.c
bug2885b.c: In function 'main':
bug2885b.c:7: error: 'NT' undeclared (first use in this function)
bug2885b.c:7: error: (Each undeclared identifier is reported only once
bug2885b.c:7: error: for each function it appears in.)
bug2885b.c:7: error: expected integer expression before end of line
$
--
Summary: Macro is not passed to openmp pragma when preprocessor
is used
Product: gcc
Version: 4.3.1
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: geir at cray dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37764
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c/37764] Macro is not passed to openmp pragma when preprocessor is used
2008-10-07 22:36 [Bug c/37764] New: Macro is not passed to openmp pragma when preprocessor is used geir at cray dot com
@ 2008-10-07 22:53 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-10-07 22:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-10-07 22:51 -------
*** This bug has been marked as a duplicate of 37023 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37764
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-07 22:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-07 22:36 [Bug c/37764] New: Macro is not passed to openmp pragma when preprocessor is used geir at cray dot com
2008-10-07 22:53 ` [Bug c/37764] " pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).