source: rtems/testsuites/libtests/dl01/dl-o1.c @ 62119d2

5
Last change on this file since 62119d2 was 62119d2, checked in by Sebastian Huber <sebastian.huber@…>, on 11/15/17 at 06:55:43

dl01, dl02, dl05: Fix unresolved printf symbol

The link time wrap of printf leads to unresolved symbols in the loadable
modules. This resulted in infinite loops and test timeouts. Use
rtems_printf() for output.

Update #3199.

  • Property mode set to 100644
File size: 747 bytes
Line 
1/*
2 * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>.  All rights reserved.
3 *
4 * The license and distribution terms for this file may be
5 * found in the file LICENSE in this distribution or at
6 * http://www.rtems.org/license/LICENSE.
7 */
8
9/**
10 * Hello World as a loadable module.
11 */
12
13#include <rtems/test.h>
14
15#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__);
16
17/*
18 * Yes a decl in the source. This is a modules main and I could not find which
19 * header main is defined in.
20 */
21int rtems_main (int argc, char* argv[]);
22
23int rtems_main (int argc, char* argv[])
24{
25  int arg;
26  printf("Loaded module: argc:%d [%s]\n", argc, __FILE__);
27  for (arg = 0; arg < argc; ++arg)
28    printf("  %d: %s\n", arg, argv[arg]);
29  return argc;
30}
Note: See TracBrowser for help on using the repository browser.