A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mv examples/platforms/trace examples/platforms/profiles
[simgrid.git]
/
tools
/
cmake
/
test_prog
/
prog_stacksetup.c
diff --git
a/tools/cmake/test_prog/prog_stacksetup.c
b/tools/cmake/test_prog/prog_stacksetup.c
index
46f0563
..
fe1f26a
100644
(file)
--- a/
tools/cmake/test_prog/prog_stacksetup.c
+++ b/
tools/cmake/test_prog/prog_stacksetup.c
@@
-1,4
+1,4
@@
-/* Copyright (c) 2010
, 2014-2016. The SimGrid Team. All rights reserved.
*/
+/* Copyright (c) 2010
-2019. The SimGrid Team. All rights reserved.
*/
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
@@
-19,14
+19,15
@@
union alltypes {
void (*fp) (void);
char *cp;
};
void (*fp) (void);
char *cp;
};
-static
volatile
char *handler_addr = (char *) 0xDEAD;
+static char *handler_addr = (char *) 0xDEAD;
static ucontext_t uc_handler;
static ucontext_t uc_main;
void handler(void)
{
char garbage[1024];
auto int dummy;
static ucontext_t uc_handler;
static ucontext_t uc_main;
void handler(void)
{
char garbage[1024];
auto int dummy;
- for (int i = 0; i < 1024; i++)
+ int i;
+ for (i = 0; i < 1024; i++)
garbage[i] = 'X';
handler_addr = (char *) &dummy;
swapcontext(&uc_handler, &uc_main);
garbage[i] = 'X';
handler_addr = (char *) &dummy;
swapcontext(&uc_handler, &uc_main);
@@
-35,13
+36,12
@@
void handler(void)
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
- FILE *f;
- char result[1024];
int sksize = 32768;
char *skbuf = (char *) malloc(sksize * 2 + 2 * sizeof(union alltypes));
if (skbuf == NULL)
exit(1);
int sksize = 32768;
char *skbuf = (char *) malloc(sksize * 2 + 2 * sizeof(union alltypes));
if (skbuf == NULL)
exit(1);
- for (int i = 0; i < sksize * 2 + 2 * sizeof(union alltypes); i++)
+ int i;
+ for (i = 0; i < sksize * 2 + 2 * sizeof(union alltypes); i++)
skbuf[i] = 'A';
char *skaddr = skbuf + sizeof(union alltypes);
skbuf[i] = 'A';
char *skaddr = skbuf + sizeof(union alltypes);
@@
-59,20
+59,15
@@
int main(int argc, char *argv[])
if (handler_addr < skaddr + sksize) {
/* stack was placed into lower area */
if (*(skaddr + sksize) != 'A')
if (handler_addr < skaddr + sksize) {
/* stack was placed into lower area */
if (*(skaddr + sksize) != 'A')
-
sprintf(result, "(skaddr)+(sksize)-%d,(sksize)-%d
", sizeof(union alltypes), sizeof(union alltypes));
+
printf("(skaddr)+(sksize)-%zu;(sksize)-%zu
", sizeof(union alltypes), sizeof(union alltypes));
else
else
-
strcpy(result, "(skaddr)+(sksize),
(sksize)");
+
printf("(skaddr)+(sksize);
(sksize)");
} else {
/* stack was placed into higher area */
if (*(skaddr + sksize * 2) != 'A')
} else {
/* stack was placed into higher area */
if (*(skaddr + sksize * 2) != 'A')
-
sprintf(result, "(skaddr),(sksize)-%d
", sizeof(union alltypes));
+
printf("(skaddr);(sksize)-%zu
", sizeof(union alltypes));
else
else
-
strcpy(result, "(skaddr),
(sksize)");
+
printf("(skaddr);
(sksize)");
}
}
- if ((f = fopen("conftestval", "w")) == NULL)
- exit(1);
- fprintf(f, "%s\n", result);
- fclose(f);
- exit(0);
- return 1;
+ return 0;
}
}