Spurious error on omp parallel for`

Issue #48 resolved
Andrew Pennebaker created an issue

When vera++ encounters an OpenMP-style for, it mistakenly thinks a standard C for loop is about to follow. But it's just a pragma.

Source:

$ cat parhello.c
// Copyright (c) YelloSoft

#include <omp.h>
#include <stdio.h>
#include <string.h>

int main() {
  char* s = "Hello World!\n";

  size_t i;

#pragma omp parallel for
  for (i = 0; i < strlen(s); i++) {
    (void) putc(s[i], stdout);
  }

  return 0;
}

Trace:

$ vera++ parhello.c
parhello.c:12: keyword 'for' not followed by a single space

Comments (3)

  1. Log in to comment