From: Martin Quinson Date: Mon, 7 Sep 2015 19:37:08 +0000 (+0200) Subject: Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid X-Git-Tag: v3_12~279 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a016b25437d8095a80a8d31965c5a33631839f24?hp=9647ab38068415bebef4605f839b4bb317528c19 Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid --- diff --git a/contrib/deployment_generation/generate_random_deployment.pl b/contrib/deployment_generation/generate_random_deployment.pl index b160b3f4ec..bd353fae3c 100755 --- a/contrib/deployment_generation/generate_random_deployment.pl +++ b/contrib/deployment_generation/generate_random_deployment.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # Copyright (c) 2009, 2011, 2014. The SimGrid Team. # All rights reserved. @@ -7,6 +7,7 @@ # under the terms of the license (GNU LGPL) which comes with this package. use strict; +use warnings; sub melange { my $tableau=shift; diff --git a/contrib/network_model/regression2.py b/contrib/network_model/regression2.py index f314d9e50e..fc4e84ba7a 100755 --- a/contrib/network_model/regression2.py +++ b/contrib/network_model/regression2.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # Copyright (c) 2011, 2014. The SimGrid Team. # All rights reserved. diff --git a/examples/java/bittorrent/generate.py b/examples/java/bittorrent/generate.py index d4ea09ee9e..155957fc08 100755 --- a/examples/java/bittorrent/generate.py +++ b/examples/java/bittorrent/generate.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # Copyright (c) 2013-2014. The SimGrid Team. # All rights reserved. diff --git a/examples/msg/bittorrent/generate.py b/examples/msg/bittorrent/generate.py index f3460bb3c9..7f0d6d455f 100755 --- a/examples/msg/bittorrent/generate.py +++ b/examples/msg/bittorrent/generate.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # Copyright (c) 2012, 2014. The SimGrid Team. # All rights reserved. diff --git a/examples/msg/chord/generate.py b/examples/msg/chord/generate.py index afc0ea9123..3b707ac48a 100755 --- a/examples/msg/chord/generate.py +++ b/examples/msg/chord/generate.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # Copyright (c) 2011-2012, 2014. The SimGrid Team. # All rights reserved. diff --git a/examples/msg/kademlia/generate.py b/examples/msg/kademlia/generate.py index b47512022c..1b9526cefb 100755 --- a/examples/msg/kademlia/generate.py +++ b/examples/msg/kademlia/generate.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # Copyright (c) 2012, 2014. The SimGrid Team. # All rights reserved. diff --git a/examples/platforms/conf/transform_optorsim_platform.pl b/examples/platforms/conf/transform_optorsim_platform.pl index 7e5369af29..d2db4d946e 100644 --- a/examples/platforms/conf/transform_optorsim_platform.pl +++ b/examples/platforms/conf/transform_optorsim_platform.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # Copyright (c) 2011, 2014. The SimGrid Team. # All rights reserved. @@ -7,6 +7,7 @@ # under the terms of the license (GNU LGPL) which comes with this package. use strict; +use warnings; if($#ARGV!=0) { die "Usage: perl transfrom_optorsim_platform.pl \n"; diff --git a/examples/platforms/generation_scripts/create_hierarchical_clusters.pl b/examples/platforms/generation_scripts/create_hierarchical_clusters.pl index 33877a1708..f6557616dc 100755 --- a/examples/platforms/generation_scripts/create_hierarchical_clusters.pl +++ b/examples/platforms/generation_scripts/create_hierarchical_clusters.pl @@ -1,4 +1,4 @@ -#! /usr/bin/perl +#! /usr/bin/env perl # Copyright (c) 2011-2012, 2014. The SimGrid Team. # All rights reserved. diff --git a/examples/platforms/generation_scripts/enhancedDTDwithHierarchicalCluster.pl b/examples/platforms/generation_scripts/enhancedDTDwithHierarchicalCluster.pl index 654f604f62..dd56ba889e 100755 --- a/examples/platforms/generation_scripts/enhancedDTDwithHierarchicalCluster.pl +++ b/examples/platforms/generation_scripts/enhancedDTDwithHierarchicalCluster.pl @@ -1,4 +1,4 @@ -#! /usr/bin/perl +#! /usr/bin/env perl # Copyright (c) 2011-2012, 2014. The SimGrid Team. # All rights reserved. diff --git a/examples/platforms/generation_scripts/generate_g5k_platform.pl b/examples/platforms/generation_scripts/generate_g5k_platform.pl index 023ffacc4f..048143fb8a 100755 --- a/examples/platforms/generation_scripts/generate_g5k_platform.pl +++ b/examples/platforms/generation_scripts/generate_g5k_platform.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # Copyright (c) 2011, 2014. The SimGrid Team. # All rights reserved. @@ -7,6 +7,7 @@ # under the terms of the license (GNU LGPL) which comes with this package. use strict; +use warnings; use Switch; my $toversion=3; diff --git a/examples/platforms/generation_scripts/generate_g5k_platform_cabinets.pl b/examples/platforms/generation_scripts/generate_g5k_platform_cabinets.pl index 220565087b..9f3818e845 100755 --- a/examples/platforms/generation_scripts/generate_g5k_platform_cabinets.pl +++ b/examples/platforms/generation_scripts/generate_g5k_platform_cabinets.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # Copyright (c) 2011, 2014. The SimGrid Team. # All rights reserved. @@ -7,6 +7,7 @@ # under the terms of the license (GNU LGPL) which comes with this package. use strict; +use warnings; use Switch; my $site=""; diff --git a/examples/platforms/syscoord/generate_peer_platform.pl b/examples/platforms/syscoord/generate_peer_platform.pl index a01bcebd1e..7b530e3ab2 100755 --- a/examples/platforms/syscoord/generate_peer_platform.pl +++ b/examples/platforms/syscoord/generate_peer_platform.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # Copyright (c) 2011, 2014. The SimGrid Team. # All rights reserved. @@ -7,6 +7,7 @@ # under the terms of the license (GNU LGPL) which comes with this package. use strict; +use warnings; my $toversion=3; my $nb_peer = $ARGV[0]; diff --git a/examples/simdag/dax/generate_forkjoin.pl b/examples/simdag/dax/generate_forkjoin.pl index aafcab1f55..545ccf9b23 100755 --- a/examples/simdag/dax/generate_forkjoin.pl +++ b/examples/simdag/dax/generate_forkjoin.pl @@ -1,4 +1,4 @@ -#! /usr/bin/perl +#! /usr/bin/env perl # Copyright (c) 2009, 2014. The SimGrid Team. # All rights reserved. diff --git a/examples/simdag/dax/generate_strassen.pl b/examples/simdag/dax/generate_strassen.pl index ec59f83884..060f8991f4 100755 --- a/examples/simdag/dax/generate_strassen.pl +++ b/examples/simdag/dax/generate_strassen.pl @@ -1,4 +1,4 @@ -#! /usr/bin/perl +#! /usr/bin/env perl # Copyright (c) 2009, 2014. The SimGrid Team. # All rights reserved. diff --git a/src/mc/mc_dwarf.cpp b/src/mc/mc_dwarf.cpp index 92835289af..3b8e900e25 100644 --- a/src/mc/mc_dwarf.cpp +++ b/src/mc/mc_dwarf.cpp @@ -276,30 +276,26 @@ static const char *MC_dwarf_at_linkage_name(Dwarf_Die * die) static Dwarf_Off MC_dwarf_attr_dieoffset(Dwarf_Die * die, int attribute) { Dwarf_Attribute attr; - if (dwarf_hasattr_integrate(die, attribute)) { - dwarf_attr_integrate(die, attribute, &attr); - Dwarf_Die subtype_die; - if (dwarf_formref_die(&attr, &subtype_die) == NULL) { - xbt_die("Could not find DIE"); - } - return dwarf_dieoffset(&subtype_die); - } else + if (dwarf_hasattr_integrate(die, attribute) == 0) return 0; + dwarf_attr_integrate(die, attribute, &attr); + Dwarf_Die subtype_die; + if (dwarf_formref_die(&attr, &subtype_die) == NULL) + xbt_die("Could not find DIE"); + return dwarf_dieoffset(&subtype_die); } static Dwarf_Off MC_dwarf_attr_integrate_dieoffset(Dwarf_Die * die, int attribute) { Dwarf_Attribute attr; - if (dwarf_hasattr_integrate(die, attribute)) { - dwarf_attr_integrate(die, DW_AT_type, &attr); - Dwarf_Die subtype_die; - if (dwarf_formref_die(&attr, &subtype_die) == NULL) { - xbt_die("Could not find DIE"); - } - return dwarf_dieoffset(&subtype_die); - } else + if (dwarf_hasattr_integrate(die, attribute) == 0) return 0; + dwarf_attr_integrate(die, DW_AT_type, &attr); + Dwarf_Die subtype_die; + if (dwarf_formref_die(&attr, &subtype_die) == NULL) + xbt_die("Could not find DIE"); + return dwarf_dieoffset(&subtype_die); } /** \brief Find the type/subtype (DW_AT_type) for a DIE @@ -404,24 +400,22 @@ static uint64_t MC_dwarf_subrange_element_count(Dwarf_Die * die, MC_dwarf_die_tagname(die)); // Use DW_TAG_count if present: - if (dwarf_hasattr_integrate(die, DW_AT_count)) { + if (dwarf_hasattr_integrate(die, DW_AT_count)) return MC_dwarf_attr_integrate_uint(die, DW_AT_count, 0); - } // Otherwise compute DW_TAG_upper_bound-DW_TAG_lower_bound + 1: - if (!dwarf_hasattr_integrate(die, DW_AT_upper_bound)) { + if (!dwarf_hasattr_integrate(die, DW_AT_upper_bound)) // This is not really 0, but the code expects this (we do not know): return 0; - } + uint64_t upper_bound = MC_dwarf_attr_integrate_uint(die, DW_AT_upper_bound, -1); uint64_t lower_bound = 0; - if (dwarf_hasattr_integrate(die, DW_AT_lower_bound)) { + if (dwarf_hasattr_integrate(die, DW_AT_lower_bound)) lower_bound = MC_dwarf_attr_integrate_uint(die, DW_AT_lower_bound, -1); - } else { + else lower_bound = MC_dwarf_default_lower_bound(dwarf_srclang(unit)); - } return upper_bound - lower_bound + 1; } @@ -447,9 +441,8 @@ static uint64_t MC_dwarf_array_element_count(Dwarf_Die * die, Dwarf_Die * unit) res = dwarf_siblingof(&child, &child)) { int child_tag = dwarf_tag(&child); if (child_tag == DW_TAG_subrange_type - || child_tag == DW_TAG_enumeration_type) { + || child_tag == DW_TAG_enumeration_type) result *= MC_dwarf_subrange_element_count(&child, unit); - } } return result; } @@ -484,19 +477,16 @@ static bool MC_compare_variable( static void MC_dwarf_fill_member_location(simgrid::mc::Type* type, simgrid::mc::Type* member, Dwarf_Die * child) { - if (dwarf_hasattr(child, DW_AT_data_bit_offset)) { + if (dwarf_hasattr(child, DW_AT_data_bit_offset)) xbt_die("Can't groke DW_AT_data_bit_offset."); - } if (!dwarf_hasattr_integrate(child, DW_AT_data_member_location)) { - if (type->type != DW_TAG_union_type) { - xbt_die - ("Missing DW_AT_data_member_location field in DW_TAG_member %s of type <%" - PRIx64 ">%s", member->name.c_str(), - (uint64_t) type->id, type->name.c_str()); - } else { + if (type->type == DW_TAG_union_type) return; - } + xbt_die + ("Missing DW_AT_data_member_location field in DW_TAG_member %s of type <%" + PRIx64 ">%s", member->name.c_str(), + (uint64_t) type->id, type->name.c_str()); } Dwarf_Attribute attr; @@ -510,12 +500,11 @@ static void MC_dwarf_fill_member_location(simgrid::mc::Type* type, simgrid::mc:: { Dwarf_Op *expr; size_t len; - if (dwarf_getlocation(&attr, &expr, &len)) { + if (dwarf_getlocation(&attr, &expr, &len)) xbt_die ("Could not read location expression DW_AT_data_member_location in DW_TAG_member %s of type <%" PRIx64 ">%s", MC_dwarf_attr_integrate_string(child, DW_AT_name), (uint64_t) type->id, type->name.c_str()); - } simgrid::mc::DwarfExpression(expr, expr+len); break; } @@ -585,17 +574,15 @@ static void MC_dwarf_add_members(simgrid::mc::ObjectInformation* info, Dwarf_Die member.element_count = -1; member.type_id = MC_dwarf_at_type(&child); - if (dwarf_hasattr(&child, DW_AT_data_bit_offset)) { + if (dwarf_hasattr(&child, DW_AT_data_bit_offset)) xbt_die("Can't groke DW_AT_data_bit_offset."); - } MC_dwarf_fill_member_location(type, &member, &child); - if (!member.type_id) { + if (!member.type_id) xbt_die("Missing type for member %s of <%" PRIx64 ">%s", member.name.c_str(), (uint64_t) type->id, type->name.c_str()); - } type->members.push_back(std::move(member)); } @@ -660,9 +647,8 @@ static simgrid::mc::Type MC_dwarf_die_to_type( || type.type == DW_TAG_structure_type || type.type == DW_TAG_class_type) { Dwarf_Word size; - if (dwarf_aggregate_size(die, &size) == 0) { + if (dwarf_aggregate_size(die, &size) == 0) type.byte_size = size; - } } switch (type.type) { @@ -717,10 +703,9 @@ static std::unique_ptr MC_die_to_variable( return nullptr; Dwarf_Attribute attr_location; - if (dwarf_attr(die, DW_AT_location, &attr_location) == NULL) { + if (dwarf_attr(die, DW_AT_location, &attr_location) == NULL) // No location: do not add it ? return nullptr; - } std::unique_ptr variable = std::unique_ptr(new simgrid::mc::Variable()); @@ -1008,20 +993,12 @@ void MC_dwarf_get_variables(simgrid::mc::ObjectInformation* info) Dwarf_Off offset = 0; Dwarf_Off next_offset = 0; size_t length; + while (dwarf_nextcu(dwarf, offset, &next_offset, &length, NULL, NULL, NULL) == 0) { Dwarf_Die unit_die; - if (dwarf_offdie(dwarf, offset + length, &unit_die) != NULL) { - - // For each child DIE: - Dwarf_Die child; - int res; - for (res = dwarf_child(&unit_die, &child); res == 0; - res = dwarf_siblingof(&child, &child)) { - MC_dwarf_handle_die(info, &child, &unit_die, NULL, NULL); - } - - } + if (dwarf_offdie(dwarf, offset + length, &unit_die) != NULL) + MC_dwarf_handle_children(info, &unit_die, &unit_die, NULL, NULL); offset = next_offset; } @@ -1073,10 +1050,9 @@ static void MC_post_process_variables(simgrid::mc::ObjectInformation* info) MC_compare_variable); for(simgrid::mc::Variable& variable : info->global_variables) - if (variable.type_id) { + if (variable.type_id) variable.type = simgrid::util::find_map_ptr( info->types, variable.type_id); - } } static void mc_post_process_scope(simgrid::mc::ObjectInformation* info, simgrid::mc::Frame* scope) @@ -1093,10 +1069,9 @@ static void mc_post_process_scope(simgrid::mc::ObjectInformation* info, simgrid: // Direct: for (simgrid::mc::Variable& variable : scope->variables) - if (variable.type_id) { + if (variable.type_id) variable.type = simgrid::util::find_map_ptr( info->types, variable.type_id); - } // Recursive post-processing of nested-scopes: for (simgrid::mc::Frame& nested_scope : scope->scopes) @@ -1162,13 +1137,13 @@ void MC_post_process_object_info(simgrid::mc::Process* process, simgrid::mc::Obj simgrid::mc::Type* type = &(i.second); simgrid::mc::Type* subtype = type; - while (subtype->type == DW_TAG_typedef || subtype->type == DW_TAG_volatile_type - || subtype->type == DW_TAG_const_type) { + while (subtype->type == DW_TAG_typedef + || subtype->type == DW_TAG_volatile_type + || subtype->type == DW_TAG_const_type) if (subtype->subtype) subtype = subtype->subtype; else break; - } // Resolve full_type: if (!subtype->name.empty() && subtype->byte_size == 0) { diff --git a/src/mc/mc_dwarf_expression.cpp b/src/mc/mc_dwarf_expression.cpp index d4926a2281..7bf23355d3 100644 --- a/src/mc/mc_dwarf_expression.cpp +++ b/src/mc/mc_dwarf_expression.cpp @@ -38,10 +38,10 @@ static int mc_dwarf_push_value(mc_expression_state_t state, Dwarf_Off value) */ static int mc_dwarf_register_to_libunwind(int dwarf_register) { -#if defined(UNW_TARGET_X86_64) +#if defined(__x86_64__) // It seems for this arch, DWARF and libunwind agree in the numbering: return dwarf_register; -#elif defined(UNW_TARGET_X86) +#elif defined(__i386__) // Could't find the authoritative source of information for this. // This is inspired from http://source.winehq.org/source/dlls/dbghelp/cpu_i386.c#L517. switch (dwarf_register) { @@ -170,7 +170,7 @@ int mc_dwarf_execute_expression(size_t n, const Dwarf_Op * ops, unw_step(&cursor); unw_word_t res; - unw_get_reg(&cursor, UNW_TDEP_SP, &res); + unw_get_reg(&cursor, UNW_REG_SP, &res); error = mc_dwarf_push_value(state, res); break; } diff --git a/src/smpi/fixsrc.pl b/src/smpi/fixsrc.pl index 2bc55d93b1..8844d208c5 100755 --- a/src/smpi/fixsrc.pl +++ b/src/smpi/fixsrc.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2011, 2014. The SimGrid Team. # All rights reserved. diff --git a/teshsuite/smpi/mpich3-test/checktests b/teshsuite/smpi/mpich3-test/checktests index ab266925cb..0c6ed522e6 100755 --- a/teshsuite/smpi/mpich3-test/checktests +++ b/teshsuite/smpi/mpich3-test/checktests @@ -1,4 +1,4 @@ -#! /usr/local/bin/perl +#! /usr/bin/env perl $debug = 1; $verbose = 1; diff --git a/teshsuite/smpi/mpich3-test/runtests b/teshsuite/smpi/mpich3-test/runtests index 8d28884459..b356be972d 100755 --- a/teshsuite/smpi/mpich3-test/runtests +++ b/teshsuite/smpi/mpich3-test/runtests @@ -1,4 +1,4 @@ -#! /usr/bin/perl +#! /usr/bin/env perl # -*- Mode: perl; -*- # # This script is the beginnings of a script to run a sequence of test diff --git a/tools/MSG_visualization/colorize.pl b/tools/MSG_visualization/colorize.pl index b3c567189d..db2676b51e 100755 --- a/tools/MSG_visualization/colorize.pl +++ b/tools/MSG_visualization/colorize.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2005, 2007, 2010, 2014. The SimGrid Team. # All rights reserved. diff --git a/tools/MSG_visualization/trace2fig.pl b/tools/MSG_visualization/trace2fig.pl index cd23d39cec..2ac7c85a82 100755 --- a/tools/MSG_visualization/trace2fig.pl +++ b/tools/MSG_visualization/trace2fig.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # Copyright (c) 2006-2007, 2014. The SimGrid Team. # All rights reserved. @@ -7,6 +7,8 @@ # under the terms of the license (GNU LGPL) which comes with this package. use strict; +use warnings; + #use Data::Dumper; use XFig; use POSIX; diff --git a/tools/cmake/Scripts/generate_memcheck_tests.pl b/tools/cmake/Scripts/generate_memcheck_tests.pl index fc4fd61816..d37977aae5 100755 --- a/tools/cmake/Scripts/generate_memcheck_tests.pl +++ b/tools/cmake/Scripts/generate_memcheck_tests.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # Copyright (c) 2012-2014. The SimGrid Team. # All rights reserved. @@ -7,6 +7,7 @@ # under the terms of the license (GNU LGPL) which comes with this package. use strict; +use warnings; # input file = AddTest.txt diff --git a/tools/cmake/Scripts/my_valgrind.pl b/tools/cmake/Scripts/my_valgrind.pl index 073b4b8a07..3b273d5d61 100755 --- a/tools/cmake/Scripts/my_valgrind.pl +++ b/tools/cmake/Scripts/my_valgrind.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # Copyright (c) 2012-2014. The SimGrid Team. # All rights reserved. @@ -7,6 +7,8 @@ # under the terms of the license (GNU LGPL) which comes with this package. use strict; +use warnings; + my @argv = ("valgrind"); my $count = 0; diff --git a/tools/cmake/Scripts/update_tesh.pl b/tools/cmake/Scripts/update_tesh.pl index 7c340b4b5e..5e0a06d174 100755 --- a/tools/cmake/Scripts/update_tesh.pl +++ b/tools/cmake/Scripts/update_tesh.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # Copyright (c) 2012, 2014. The SimGrid Team. # All rights reserved. @@ -7,6 +7,7 @@ # under the terms of the license (GNU LGPL) which comes with this package. use strict; +use warnings; if($#ARGV!=1) { die "Usage: perl make_tesh.pl \n"; diff --git a/tools/doxygen/fig2dev_postprocessor.pl b/tools/doxygen/fig2dev_postprocessor.pl index b5b7d82215..d14ce0933e 100755 --- a/tools/doxygen/fig2dev_postprocessor.pl +++ b/tools/doxygen/fig2dev_postprocessor.pl @@ -1,4 +1,4 @@ -#! /usr/bin/perl +#! /usr/bin/env perl # Copyright (c) 2010, 2014. The SimGrid Team. # All rights reserved. diff --git a/tools/doxygen/index_create.pl b/tools/doxygen/index_create.pl index f9f58d2953..7d23af0a58 100755 --- a/tools/doxygen/index_create.pl +++ b/tools/doxygen/index_create.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # Copyright (c) 2005, 2012-2014. The SimGrid Team. # All rights reserved. @@ -6,6 +6,8 @@ # 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. +use warnings; + ($#ARGV >= 1) or die "Usage: index_create.pl "; my($type) = ""; diff --git a/tools/doxygen/xbt_log_extract_hierarchy.pl b/tools/doxygen/xbt_log_extract_hierarchy.pl index 40f60ee650..ba13f8aac8 100755 --- a/tools/doxygen/xbt_log_extract_hierarchy.pl +++ b/tools/doxygen/xbt_log_extract_hierarchy.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2008, 2010, 2012-2014. The SimGrid Team. # All rights reserved. diff --git a/tools/internal/generate-multi-jar.py b/tools/internal/generate-multi-jar.py index c200c49e58..41ec224c1b 100755 --- a/tools/internal/generate-multi-jar.py +++ b/tools/internal/generate-multi-jar.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # Copyright (c) 2013-2014. The SimGrid Team. # All rights reserved. diff --git a/tools/internal/spell_comments.pl b/tools/internal/spell_comments.pl index 5ab59587f4..7ff91da032 100755 --- a/tools/internal/spell_comments.pl +++ b/tools/internal/spell_comments.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2013-2015. The SimGrid Team. # All rights reserved. @@ -13,6 +13,7 @@ # Copyright 2003, Dan Kegel. Licensed under GPL. See the file ../COPYING for details. use strict; +use warnings; die "Please install iamerican to use that script." unless (-r "/usr/lib/ispell/american.hash"); diff --git a/tools/normalize-pointers.py b/tools/normalize-pointers.py index 04049fa48f..ba78a8078c 100755 --- a/tools/normalize-pointers.py +++ b/tools/normalize-pointers.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # Copyright (c) 2013-2014. The SimGrid Team. # All rights reserved. diff --git a/tools/sg_unit_extractor.pl b/tools/sg_unit_extractor.pl index 1c29e79fab..6502ccfa73 100755 --- a/tools/sg_unit_extractor.pl +++ b/tools/sg_unit_extractor.pl @@ -1,4 +1,4 @@ -#! /usr/bin/perl +#! /usr/bin/env perl # Copyright (c) 2005-2012, 2014. The SimGrid Team. # All rights reserved. diff --git a/tools/stack-cleaner/as b/tools/stack-cleaner/as index 1a66dd3798..46446cb3f0 100755 --- a/tools/stack-cleaner/as +++ b/tools/stack-cleaner/as @@ -1,4 +1,4 @@ -#!/usr/bin/ruby +#!/usr/bin/env ruby # Wrapper around the real `as` which adds filtering capabilities. require "tempfile" diff --git a/tools/stack-cleaner/clean-stack-filter b/tools/stack-cleaner/clean-stack-filter index a2f91aa0ad..64e79903c5 100755 --- a/tools/stack-cleaner/clean-stack-filter +++ b/tools/stack-cleaner/clean-stack-filter @@ -1,9 +1,10 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # Transform assembly in order to clean each stack frame for X86_64. use strict; -$SIG{__WARN__} = sub { die @_ }; +use warnings; +$SIG{__WARN__} = sub { die @_ }; # Whether we are still scanning the content of a function: our $scanproc = 0; diff --git a/tools/stack-cleaner/compiler-wrapper b/tools/stack-cleaner/compiler-wrapper index 8b8a62f5fd..62504af416 100755 --- a/tools/stack-cleaner/compiler-wrapper +++ b/tools/stack-cleaner/compiler-wrapper @@ -1,7 +1,9 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # Compiler wrapper with stack-cleaner support (enabled by default). # Usage: ./compiler-wrapper target-compiler args [-f[no-]stack-cleaner] +use warnings; + use File::Basename; my $compiler = shift(@ARGV); diff --git a/tools/tesh/colorize.pl b/tools/tesh/colorize.pl index 9cc8d183c9..88b1f55e86 100755 --- a/tools/tesh/colorize.pl +++ b/tools/tesh/colorize.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # Copyright (c) 2010, 2014. The SimGrid Team. # All rights reserved. @@ -6,6 +6,8 @@ # 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. +use warnings; + use Term::ANSIColor qw{:constants}; $Term::ANSIColor::AUTORESET = 1; diff --git a/tools/tesh/tesh.pl b/tools/tesh/tesh.pl index 2dd685b593..e83cbc6441 100755 --- a/tools/tesh/tesh.pl +++ b/tools/tesh/tesh.pl @@ -1,4 +1,4 @@ -#! /usr/bin/perl +#! /usr/bin/env perl # Copyright (c) 2012-2014. The SimGrid Team. # All rights reserved.